Skip to content

Commit 9272e8e

Browse files
committed
Add our own installation scheme to sysconfig
1 parent 8419133 commit 9272e8e

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_sysconfig.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*graalpython.lib-python.3.test.test_sysconfig.TestSysConfig.test_SO_deprecation
33
*graalpython.lib-python.3.test.test_sysconfig.TestSysConfig.test_SO_in_vars
44
*graalpython.lib-python.3.test.test_sysconfig.TestSysConfig.test_SO_value
5+
*graalpython.lib-python.3.test.test_sysconfig.TestSysConfig.test_get_config_h_filename
56
*graalpython.lib-python.3.test.test_sysconfig.TestSysConfig.test_get_config_vars
67
*graalpython.lib-python.3.test.test_sysconfig.TestSysConfig.test_get_path
78
*graalpython.lib-python.3.test.test_sysconfig.TestSysConfig.test_get_path_names

graalpython/lib-python/3/sysconfig.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
]
2121

2222
_INSTALL_SCHEMES = {
23+
# Graalpython change: custom scheme
24+
'graalpython': {
25+
'stdlib': '{base}/lib-python/3',
26+
'platstdlib': '{base}/lib-python/3',
27+
'purelib': '{base}/lib-python/3/site-packages',
28+
'platlib': '{base}/lib-python/3/site-packages',
29+
'include': '{base}/include',
30+
'platinclude': '{base}/include',
31+
'scripts': '{base}/bin',
32+
'data': '{base}',
33+
},
2334
'posix_prefix': {
2435
'stdlib': '{installed_base}/lib/python{py_version_short}',
2536
'platstdlib': '{platbase}/lib/python{py_version_short}',
@@ -180,10 +191,12 @@ def _expand_vars(scheme, vars):
180191

181192

182193
def _get_default_scheme():
183-
if os.name == 'posix':
184-
# the default scheme for posix is posix_prefix
185-
return 'posix_prefix'
186-
return os.name
194+
# XXX Graalpython change
195+
return 'graalpython'
196+
# if os.name == 'posix':
197+
# # the default scheme for posix is posix_prefix
198+
# return 'posix_prefix'
199+
# return os.name
187200

188201

189202
# NOTE: site.py has copy of this function.

graalpython/lib-python/3/test/test_sysconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ def test_get_config_h_filename(self):
228228
self.assertTrue(os.path.isfile(config_h), config_h)
229229

230230
def test_get_scheme_names(self):
231-
wanted = ('nt', 'nt_user', 'osx_framework_user',
231+
# XXX Graalpython change: add our scheme
232+
wanted = ('graalpython', 'nt', 'nt_user', 'osx_framework_user',
232233
'posix_home', 'posix_prefix', 'posix_user')
233234
self.assertEqual(get_scheme_names(), wanted)
234235

0 commit comments

Comments
 (0)