diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2591b16a0..c901ada03 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/Lib/site.py b/Lib/site.py index 06c103333..6d5dca641 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -275,7 +275,8 @@ def _getuserbase(): 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, @@ -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: diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index f14b138bb..9999d6bbd 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -1,3 +1,5 @@ +# XXX: RUSTPYTHON; Trick to make sysconfig work as RustPython +exec(r''' """Access to Python's configuration information.""" import os @@ -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")) diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index d8e046570..fb9aca659 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -288,13 +288,15 @@ class HelperFunctionsTests(unittest.TestCase): 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: