Skip to content

Commit 67b1739

Browse files
committed
install setuptools ourselves
1 parent 6e3cccf commit 67b1739

File tree

4 files changed

+39
-14
lines changed

4 files changed

+39
-14
lines changed

graalpython/lib-python/3/distutils/command/install.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
INSTALL_SCHEMES = {
3131
'unix_prefix': {
32-
'purelib': '$base/lib/python$py_version_short/site-packages',
33-
'platlib': '$platbase/lib/python$py_version_short/site-packages',
32+
'purelib': '$base/lib-python/$py_version_major/site-packages',
33+
'platlib': '$platbase/lib-python/$py_version_major/site-packages',
3434
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
3535
'scripts': '$base/bin',
3636
'data' : '$base',
@@ -291,6 +291,7 @@ def finalize_options(self):
291291
'dist_version': self.distribution.get_version(),
292292
'dist_fullname': self.distribution.get_fullname(),
293293
'py_version': py_version,
294+
'py_version_major': '%d' % sys.version_info[0],
294295
'py_version_short': '%d.%d' % sys.version_info[:2],
295296
'py_version_nodot': '%d%d' % sys.version_info[:2],
296297
'sys_prefix': prefix,

graalpython/lib-python/3/site-packages/.keep

Whitespace-only changes.

graalpython/site-packages/Makefile

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
.PHONY: clean install
22

3-
SHELL = /bin/bash
4-
SITE_PATH = ../lib-python/3/site-packages
5-
SETUPTOOLS_VERSION = 40.4.3
63

7-
default: install
4+
SETUPTOOLS_VERSION = 40.6.3
5+
PYTHON_VERSION = 3.7
6+
7+
SETUPTOOLS_DIR = setuptools-${SETUPTOOLS_VERSION}
8+
IN_SETUPTOOLS_DIR = cd ${SETUPTOOLS_DIR} &&
9+
SITE_PATH = ../lib-python/3/site-packages/
10+
811

9-
install: ${SITE_PATH} ${SITE_PATH}/setuptools.pth
12+
QUIETLY$(MX_VERBOSE) = @
13+
OPT_QUIET$(MX_VERBOSE) = --quiet
14+
OPT_VERBOSE =
1015

11-
${SITE_PATH}:
12-
mkdir -p ${SITE_PATH}
16+
ifeq ($(MX_VERBOSE),y)
17+
OPT_VERBOSE = -v
18+
endif
19+
20+
21+
default: install
1322

14-
${SITE_PATH}/setuptools.pth:
15-
PYTHONPATH=${SITE_PATH} python3 -m easy_install --always-copy --exclude-scripts --always-unzip --install-dir ${SITE_PATH} setuptools==${SETUPTOOLS_VERSION}
16-
find ${SITE_PATH} -name "*.pyc" -exec rm "{}" ";"
17-
rm -rf ${SITE_PATH}/__pycache__
23+
install:
24+
$(QUIETLY) mx $(OPT_VERBOSE) python3 -m zipfile -e ${SETUPTOOLS_ZIP} .
25+
$(QUIETLY) ${IN_SETUPTOOLS_DIR} mx $(OPT_VERBOSE) python3 bootstrap.py
26+
$(QUIETLY) ${IN_SETUPTOOLS_DIR} mx $(OPT_VERBOSE) python3 setup.py $(OPT_QUIET) install
1827

1928
clean:
20-
rm -rf ${SITE_PATH}
29+
$(QUIETLY) rm -rf ${SETUPTOOLS_DIR}
30+
$(QUIETLY) rm -rf ${SITE_PATH}/*

mx.graalpython/suite.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
#
8585
# --------------------------------------------------------------------------------------------------------------
8686
"libraries": {
87+
"SETUPTOOLS": {
88+
"urls": [
89+
"https://github.com/pypa/setuptools/archive/v40.6.3.zip",
90+
],
91+
"sha1": "7a5960b8062ddbf0c0e79f806e23785d55fec3c8",
92+
}
8793
},
8894

8995
# --------------------------------------------------------------------------------------------------------------
@@ -242,6 +248,14 @@
242248
"output": ".",
243249
"license": ["MIT"],
244250
"defaultBuild": False,
251+
"buildEnv": {
252+
"SETUPTOOLS_ZIP": "<path:SETUPTOOLS>",
253+
},
254+
"buildDependencies": [
255+
"SETUPTOOLS",
256+
"GRAALPYTHON-LAUNCHER",
257+
"GRAALPYTHON",
258+
],
245259
},
246260
},
247261

0 commit comments

Comments
 (0)