Skip to content

Improve sysconfig CLI #132726

@donBarbos

Description

@donBarbos

Proposal:

Currently, the sysconfig module's CLI is fairly hidden and inaccessible. I think there are two main issues with the module CLI.

  1. There is no "Command Line Interface" section of the docs (only have example for python -m sysconfig output) like there is with some other modules e.g. random. (It is, however, listed under the Modules command-line interface section)
  2. There is no help section when running the platform CLI, the CLI takes argument --generate-posix-vars, which I could only find from looking at the source in ./Lib/sysconfig/__main__.py.

Inspired by #131524

I suggest adding a 1. full-fledged CommandLineTest class to the tests (currently there is only test_main which only checks that the output is present), 2. update the documentation so that it is the same as other command line interaces, 3. use argparse as a quality CLI tool

P.S.: sysconfig CLI was added in January 2010 for Python 3.2 (edacea3)

I'm happy to submit a PR if needed.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions