Skip to content

RFC: On updates to the f2py CLI #24552

Closed
Closed
@HaoZeke

Description

@HaoZeke

Scope

The complexity (perceived or otherwise) and maintainer burden of f2py is largely in two sections:

  1. The frontend parser for command-line options which operates directly on sys.argv
  2. Parsing the Fortran grammar into an operable form
  3. Generating equivalent Python, sometimes with more Fortran

This is only to discuss (1) though (2) might be made more palpable with Lark (noted here, supports regex based parsing). (3) is where most user-facing requests happen.

Context

(1) was tackled by @NamamiShanker in #21923 (earlier guidelines in #21700, now superseded) but, the CLI in f2py2e can be tricky, with some global state and other considerations. There seems to be little appetite for a wholesale rewrite of the CLI without additional tests (as noted by @mattip), which makes sense, given the large number of (mostly unknown / silent) downstream users.

That isn't to say the existing CLI is bug free (#20520), or unambiguous for both new and experienced users (#22819).

Proposal

Moving forward, the plan is to upgrade the CLI incrementally as needed. Practically this means pre-processing sys.argv for now as seen here.

This will keep compatibility and make it easier to review / reason / work with updates to the CLI. Eventually some day, the entire CLI will be in argparse, but incrementally seems to be the best way forward.

There is no deadline for the implementation of the CLI in argparse, and this is mostly an informational document.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions