Skip to content

New sysconfig API: Install paths #103481

Description

@FFY00

Feature or enhancement

We should replace sysconfig.get_paths() with something that can accurately describe the current reality.

Pitch

The new API should:

  • Support optional paths (eg. not all schemes can provide a scripts directory)
  • Introduce the concept of writable and read-only paths (this should be the default for stdlib for eg.)
  • Introduce the concept of active location schemes (eg. posix_user should not be available on virtual environments)

API design

Previous discussion

https://discuss.python.org/t/building-extensions-modules-in-a-post-distutils-world/23938
https://discuss.python.org/t/pep-582-python-local-packages-directory/963/391
https://discuss.python.org/t/linux-distro-patches-to-sysconfig-are-changing-pip-install-prefix-outside-virtual-environments/18240/28
https://discuss.python.org/t/deprecating-the-headers-wheel-data-key/23712

New sysconfig API meta-issue: GH-103480

Activity

  1. pradyunsg commented on Apr 19, 2023

    @pradyunsg
    Member

    Support optional paths (eg. not all schemes can provide a scripts directory)

    Are there specific examples? What is the usecase for "optional" scheme paths?

  2. FFY00 commented on May 2, 2023

    @FFY00
    MemberAuthor

    PEP 582 would be a good example in a normal environment. See https://discuss.python.org/t/pep-582-python-local-packages-directory/963/391 for some of the discussion regarding it.

    WASM would be a good example of a new type of environment where certain paths, like scripts or include, don't make sense (at the moment at least) 1.

    Footnotes

    1. PyScript, for eg., currently returns nonexistent paths in sysconfig.get_paths(). ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions