pypa / installer

A low-level library for installing from a Python wheel distribution.
https://installer.readthedocs.io/
MIT License
126 stars 51 forks source link

Expose a utility function to use for sysconfig/distutils paths+scheme handling like pip #145

Open pradyunsg opened 1 year ago

pradyunsg commented 1 year ago

xref: https://github.com/pypa/pip/issues/11585

Basically, the idea is to mimic the logic in pip's locations subpackage, and expose that via a single function to end users.

FFY00 commented 1 year ago

Does the locations subpackage do anything other than handling vendor patching?

pradyunsg commented 1 year ago

Yes.

See https://github.com/pypa/pip/blob/90f51db1a32592430f2e4f6fbb9efa7a3a249423/src/pip/_internal/locations/_sysconfig.py#L124 and the distutils equivalent for some of the details.

There's also logic to handle the underlying sysconfig/distutils migration, which may be worth mirroring here (depending on how complex that would be).

pradyunsg commented 1 year ago

From #146, we should probably also expose this in the CLI.