mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Update sysconfig to 3.14.4 (#7821)
* Update `test_sysconfig.py` to 3.14.4 * Update `sysconfig` to 3.14.4
This commit is contained in:
14
Lib/sysconfig/__init__.py
vendored
14
Lib/sysconfig/__init__.py
vendored
@@ -107,7 +107,7 @@ else:
|
||||
_INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_venv']
|
||||
|
||||
def _get_implementation():
|
||||
return 'RustPython' # XXX: For site-packages
|
||||
return 'RustPython' # XXX: RUSTPYTHON; For site-packages
|
||||
|
||||
# NOTE: site.py has copy of this function.
|
||||
# Sync it when modify this function.
|
||||
@@ -698,11 +698,19 @@ def get_platform():
|
||||
release = get_config_var("ANDROID_API_LEVEL")
|
||||
|
||||
# Wheel tags use the ABI names from Android's own tools.
|
||||
# When Python is running on 32-bit ARM Android on a 64-bit ARM kernel,
|
||||
# 'os.uname().machine' is 'armv8l'. Such devices run the same userspace
|
||||
# code as 'armv7l' devices.
|
||||
# During the build process of the Android testbed when targeting 32-bit ARM,
|
||||
# '_PYTHON_HOST_PLATFORM' is 'arm-linux-androideabi', so 'machine' becomes
|
||||
# 'arm'.
|
||||
machine = {
|
||||
"x86_64": "x86_64",
|
||||
"i686": "x86",
|
||||
"aarch64": "arm64_v8a",
|
||||
"arm": "armeabi_v7a",
|
||||
"armv7l": "armeabi_v7a",
|
||||
"armv8l": "armeabi_v7a",
|
||||
"i686": "x86",
|
||||
"x86_64": "x86_64",
|
||||
}[machine]
|
||||
elif osname == "linux":
|
||||
# At least on Linux/Intel, 'machine' is the processor --
|
||||
|
||||
16
Lib/test/test_sysconfig.py
vendored
16
Lib/test/test_sysconfig.py
vendored
@@ -376,10 +376,12 @@ class TestSysConfig(unittest.TestCase, VirtualEnvironmentMixin):
|
||||
sys.platform = 'android'
|
||||
get_config_vars()['ANDROID_API_LEVEL'] = 9
|
||||
for machine, abi in {
|
||||
'x86_64': 'x86_64',
|
||||
'i686': 'x86',
|
||||
'aarch64': 'arm64_v8a',
|
||||
'arm': 'armeabi_v7a',
|
||||
'armv7l': 'armeabi_v7a',
|
||||
'armv8l': 'armeabi_v7a',
|
||||
'i686': 'x86',
|
||||
'x86_64': 'x86_64',
|
||||
}.items():
|
||||
with self.subTest(machine):
|
||||
self._set_uname(('Linux', 'localhost', '3.18.91+',
|
||||
@@ -587,10 +589,12 @@ class TestSysConfig(unittest.TestCase, VirtualEnvironmentMixin):
|
||||
machine = platform.machine()
|
||||
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||
expected_triplet = {
|
||||
"x86_64": "x86_64-linux-android",
|
||||
"i686": "i686-linux-android",
|
||||
"aarch64": "aarch64-linux-android",
|
||||
"arm": "arm-linux-androideabi",
|
||||
"armv7l": "arm-linux-androideabi",
|
||||
"armv8l": "arm-linux-androideabi",
|
||||
"i686": "i686-linux-android",
|
||||
"x86_64": "x86_64-linux-android",
|
||||
}[machine]
|
||||
self.assertEndsWith(suffix, f"-{expected_triplet}.so")
|
||||
|
||||
@@ -656,8 +660,8 @@ class TestSysConfig(unittest.TestCase, VirtualEnvironmentMixin):
|
||||
self.assertEqual(abi_thread, '')
|
||||
self.assertNotIn('t', ABIFLAGS)
|
||||
|
||||
@unittest.skipIf(os.name == "nt", "TODO: RUSTPYTHON; venv creates python.exe but sys.executable is rustpython.exe")
|
||||
@requires_subprocess()
|
||||
@unittest.skipIf(os.name == 'nt', 'TODO: RUSTPYTHON; venv creates python.exe but sys.executable is rustpython.exe')
|
||||
def test_makefile_overwrites_config_vars(self):
|
||||
script = textwrap.dedent("""
|
||||
import sys, sysconfig
|
||||
@@ -690,8 +694,8 @@ class TestSysConfig(unittest.TestCase, VirtualEnvironmentMixin):
|
||||
self.assertNotEqual(data['prefix'], data['base_prefix'])
|
||||
self.assertNotEqual(data['exec_prefix'], data['base_exec_prefix'])
|
||||
|
||||
@unittest.skipIf(os.name != 'posix', '_sysconfig-vars JSON file is only available on POSIX')
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON; JSON is generated at build time in CPython
|
||||
@unittest.skipIf(os.name != 'posix', '_sysconfig-vars JSON file is only available on POSIX')
|
||||
@unittest.skipIf(is_wasi, "_sysconfig-vars JSON file currently isn't available on WASI")
|
||||
@unittest.skipIf(is_android or is_apple_mobile, 'Android and iOS change the prefix')
|
||||
def test_sysconfigdata_json(self):
|
||||
|
||||
Reference in New Issue
Block a user