Skip to content

Commit 13208ea

Browse files
authored
Merge pull request #4478 from bartoldeman/setup-py-no-distutils
Remove `distutils` use from `setup.py`
2 parents 5a2f3e8 + 7f960ad commit 13208ea

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
run: |
134134
# make sure there are no (top-level) "import setuptools" or "import pkg_resources" statements,
135135
# since EasyBuild should not have a runtime requirement on setuptools
136-
SETUPTOOLS_IMPORTS=$(egrep -RI '^(from|import)[ ]*pkg_resources|^(from|import)[ ]*setuptools' * || true)
136+
SETUPTOOLS_IMPORTS=$(egrep --exclude setup.py -RI '^(from|import)[ ]*pkg_resources|^(from|import)[ ]*setuptools' * || true)
137137
test "x$SETUPTOOLS_IMPORTS" = "x" || (echo "Found setuptools and/or pkg_resources imports in easybuild/:\n${SETUPTOOLS_IMPORTS}" && exit 1)
138138
139139
- name: install sources

setup.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@
2424
##
2525
"""
2626
This script can be used to install easybuild-framework, e.g. using:
27-
easy_install --user .
28-
or
29-
python setup.py --prefix=$HOME/easybuild
27+
python setup.py install --prefix=$HOME/easybuild
3028
3129
@author: Kenneth Hoste (Ghent University)
3230
"""
3331
import glob
3432
import os
35-
from distutils import log
36-
from distutils.core import setup
33+
import logging
34+
try:
35+
from distutils.core import setup
36+
except ImportError:
37+
from setuptools import setup
3738

3839
from easybuild.tools.version import VERSION
3940

@@ -45,8 +46,10 @@ def read(fname):
4546
return open(os.path.join(os.path.dirname(__file__), fname)).read()
4647

4748

48-
# log levels: 0 = WARN (default), 1 = INFO, 2 = DEBUG
49-
log.set_verbosity(1)
49+
log = logging.getLogger("EasyBuild")
50+
51+
# log levels: NOTSET (default), DEBUG, INFO, WARNING, ERROR, CRITICAL
52+
log.setLevel(logging.INFO)
5053

5154
log.info("Installing version %s (API version %s)" % (VERSION, API_VERSION))
5255

0 commit comments

Comments
 (0)