RustPython icon indicating copy to clipboard operation
RustPython copied to clipboard

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

Open youknowone opened this issue 2 years ago • 8 comments

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

youknowone avatar Apr 23 '23 03:04 youknowone

#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 avatar Apr 23 '23 07:04 itsankitkp

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)

itsankitkp avatar Apr 23 '23 07:04 itsankitkp

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 avatar Apr 23 '23 08:04 youknowone

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

youknowone avatar Apr 23 '23 08:04 youknowone

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 avatar Apr 23 '23 11:04 itsankitkp

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

itsankitkp avatar Apr 23 '23 11:04 itsankitkp

CPython issue: https://github.com/python/cpython/issues/103708

youknowone avatar Apr 23 '23 17:04 youknowone

The fix is merged! @itsankitkp Thank you!

youknowone avatar Jan 12 '24 12:01 youknowone