X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ jobs:
run: |
target/release/rustpython -m ensurepip
target/release/rustpython -c "import pip"
- if: runner.os != 'Windows'
name: Check if pip inside venv is functional
run: |
target/release/rustpython -m venv testvenv
testvenv/bin/rustpython -m pip install wheel
- name: Check whats_left is not broken
run: python -I whats_left.py

Expand Down
6 changes: 4 additions & 2 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def joinuser(*args):

if os.name == "nt":
base = os.environ.get("APPDATA") or "~"
return joinuser(base, "Python")
# XXX: RUSTPYTHON; please keep this change for site-packages
return joinuser(base, "RustPython")

if sys.platform == "darwin" and sys._framework:
return joinuser("~", "Library", sys._framework,
Expand Down Expand Up @@ -368,7 +369,8 @@ def getsitepackages(prefixes=None):

for libdir in libdirs:
path = os.path.join(prefix, libdir,
"python%d.%d" % sys.version_info[:2],
# XXX: RUSTPYTHON; please keep this change for site-packages
"rustpython%d.%d" % sys.version_info[:2],
"site-packages")
sitepackages.append(path)
else:
Expand Down
8 changes: 3 additions & 5 deletions Lib/sysconfig.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# XXX: RUSTPYTHON; Trick to make sysconfig work as RustPython
exec(r'''
"""Access to Python's configuration information."""

import os
Expand Down Expand Up @@ -851,10 +853,6 @@ def _main():
print()
_print_dict('Variables', get_config_vars())

# XXX RUSTPYTHON: replace python with rustpython in all these paths
for group in _INSTALL_SCHEMES.values():
for key in group.keys():
group[key] = group[key].replace("Python", "RustPython").replace("python", "rustpython")

if __name__ == '__main__':
_main()
'''.replace("Python", "RustPython").replace("/python", "/rustpython"))
6 changes: 4 additions & 2 deletions Lib/test/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,15 @@ def test_getsitepackages(self):
if sys.platlibdir != "lib":
self.assertEqual(len(dirs), 2)
wanted = os.path.join('xoxo', sys.platlibdir,
'python%d.%d' % sys.version_info[:2],
# XXX: RUSTPYTHON
'rustpython%d.%d' % sys.version_info[:2],
'site-packages')
self.assertEqual(dirs[0], wanted)
else:
self.assertEqual(len(dirs), 1)
wanted = os.path.join('xoxo', 'lib',
'python%d.%d' % sys.version_info[:2],
# XXX: RUSTPYTHON
'rustpython%d.%d' % sys.version_info[:2],
'site-packages')
self.assertEqual(dirs[-1], wanted)
else:
Expand Down
X Tutup