Skip to content

Install a static installation description file as part of the Python installation #107956

Closed
@FFY00

Description

@FFY00

Feature or enhancement

Ship a static file that describes various aspects of the installation as part of the Python installation.

UPDATE: Proposed as PEP 739, which has been accepted.

Pitch

Shipping such a file would make it much easier to introspect a Python installation without having to run the interpreter. There are many use-cases for this, but some key would be for eg. Python launchers, and cross-compilation tooling.

Information we could provide:

  • Python language version
  • Python implementation (inc. version)
  • Interpreter path
  • Standard library path
  • Interpreter architecture
  • Python ABI
    • Tag (PEP 3149 on Posix)
    • Build flags (debug, trace refs)
  • Static libpython (available?)
    • Name
    • Location
  • Shared libpython (available?)
    • Name (standard library)
    • Major-only pin library name (eg. libpython3.so)
    • Location
  • C API
    • Hex version
    • Include paths
    • Required C flags
  • Supported native module file extensions
    • Interpreter-specific
    • Stable ABI

(incomplete table, just an initial proposal)

Note: This issue specifically targets a descriptor file for the Python installation, not a Python environment, so paths are out of scope.

Previous discussion

https://discuss.python.org/t/what-information-is-useful-to-know-statically-about-an-interpreter/25563.

(cc @brettcannon)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions