Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make site-packages implementation configurable #103708

Closed
itsankitkp opened this issue Apr 23, 2023 · 0 comments
Closed

Make site-packages implementation configurable #103708

itsankitkp opened this issue Apr 23, 2023 · 0 comments
Labels
topic-sysconfig type-feature A feature request or enhancement

Comments

@itsankitkp
Copy link
Contributor

itsankitkp commented Apr 23, 2023

Enhancement

It is confusing for different implementations of python (eg pypy and rustpython) to specify correct layout of site-packages, whether they should include their own implementation (by making huge diffs in sysconfig.py) or use same as cpython's implementation viz pythonX.Y. Pypy has good solution of this problem where sysconfig _INSTALL_SCHEMES has term implementation_lower (lower counterpart of implementation). Definition of implementation is up to different flavours of python to decide. This can reduce lot of diffs in sysconfig.py in various implementations and make layout of site-packages more uniform.

Example (taken from Pypi implementation)

    'posix_prefix': {
        'stdlib': '{base}/lib/{implementation_lower}{py_version_short}',
        'platstdlib': '{platbase}/lib/{implementation_lower}{py_version_short}',
        'purelib': '{base}/lib/{implementation_lower}{py_version_short}/site-packages',
        'platlib': '{platbase}/lib/{implementation_lower}{py_version_short}/site-packages',
        'include': '{base}/include/{implementation_lower}{py_version_short}',
        'platinclude': '{platbase}/include/{implementation_lower}{py_version_short}',
        'scripts': '{base}/bin',
        'data': '{base}',
        }
def _get_implementation():
    if sys.implementation.name == 'pypy':
        return 'PyPy'
    return 'Python'

Related discussions

RustPython/RustPython#4925

Reference: https://github.com/mozillazg/pypy/blob/master/lib-python/2.7/sysconfig.py

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-sysconfig type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants