8000 site-packages path to pythonx.y or rustpythonx.y? · Issue #4925 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content

site-packages path to pythonx.y or rustpythonx.y? #4925

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

Open
youknowone opened this issue Apr 23, 2023 · 8 comments
Open

site-packages path to pythonx.y or rustpythonx.y? #4925

youknowone opened this issue Apr 23, 2023 · 8 comments

Comments

@youknowone
Copy link
Member
youknowone commented Apr 23, 2023

questions

  • Which one is better?
  • How's other distributions do?
    • If they do special handling, why doesn't it exist under Lib/sysconfig.py?
  • Which one fits better to minimize stdlib diff from CPython?

recent changes: #4924

@itsankitkp
Copy link
Contributor
itsankitkp commented Apr 23, 2023

#2. pypy adds site-packages to Lib/pypy3.8
I checked code in pypy3.8-v7.3.11-linux64
Their sysconfig looks like this (for schemes)

    'posix_prefix': {
        'stdlib': '{installed_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':
            '{installed_base}/include/{implementation_lower}{py_version_short}{abiflags}',
        'platinclude':
            '{installed_platbase}/include/{implementation_lower}{py_version_short}{abiflags}',
        'scripts': '{base}/bin',
        'data': '{base}',
        }

where implementation is defined as

def _get_implementation():
    if sys.implementation.name == 'pypy':
        return 'PyPy'
    return 'Python'

For #1 I prefer having rustpython as it minimizes any confusion (where my site-packages are) but it does add diffs in #3.

@itsankitkp
Copy link
Contributor
itsankitkp commented Apr 23, 2023

Couldn't check Jython for venv site packages as it doesn't support python3 (yet!) and IronPython needs .NET framework (need to figure out how to emulate this on linux)

@youknowone
Copy link
Member Author

Thank you! Practically graalpython will be the last part, but I think checking pypy was enough.

Maybe filing a patch from pypy to CPython and taking it from RustPython will be a way - if CPython accepts it.

@youknowone
Copy link
Member Author

I am a bit confused. The file looks under 2.7 path, but it is still used in python3, right? Last edit was 4 months ago.

https://foss.heptapod.net/pypy/pypy/-/blob/branch/default/lib-python/2.7/sysconfig.py

@itsankitkp
Copy link
Contributor

Thank you! Practically graalpython will be the last part, but I think checking pypy was enough.

Maybe filing a patch from pypy to CPython and taking it from RustPython will be a way - if CPython accepts it.

Opened an issue in cpython

@itsankitkp
Copy link
Contributor

I am a bit confused. The file looks under 2.7 path, but it is still used in python3, right? Last edit was 4 months ago.

https://foss.heptapod.net/pypy/pypy/-/blob/branch/default/lib-python/2.7/sysconfig.py

I think this is for pypy 2.7, I don't see venv module anywhere in above source tree. Source tarball which I have does have venv module

@youknowone
Copy link
Member Author

CPython issue: python/cpython#103708

@youknowone
Copy link
Member Author

The fix is merged! @itsankitkp Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0