Skip to content

Commit

Permalink
Merge pull request #4478 from bartoldeman/setup-py-no-distutils
Browse files Browse the repository at this point in the history
Remove `distutils` use from `setup.py`
  • Loading branch information
boegel authored Dec 4, 2024
2 parents 5a2f3e8 + 7f960ad commit 13208ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
run: |
# make sure there are no (top-level) "import setuptools" or "import pkg_resources" statements,
# since EasyBuild should not have a runtime requirement on setuptools
SETUPTOOLS_IMPORTS=$(egrep -RI '^(from|import)[ ]*pkg_resources|^(from|import)[ ]*setuptools' * || true)
SETUPTOOLS_IMPORTS=$(egrep --exclude setup.py -RI '^(from|import)[ ]*pkg_resources|^(from|import)[ ]*setuptools' * || true)
test "x$SETUPTOOLS_IMPORTS" = "x" || (echo "Found setuptools and/or pkg_resources imports in easybuild/:\n${SETUPTOOLS_IMPORTS}" && exit 1)
- name: install sources
Expand Down
17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@
##
"""
This script can be used to install easybuild-framework, e.g. using:
easy_install --user .
or
python setup.py --prefix=$HOME/easybuild
python setup.py install --prefix=$HOME/easybuild
@author: Kenneth Hoste (Ghent University)
"""
import glob
import os
from distutils import log
from distutils.core import setup
import logging
try:
from distutils.core import setup
except ImportError:
from setuptools import setup

from easybuild.tools.version import VERSION

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


# log levels: 0 = WARN (default), 1 = INFO, 2 = DEBUG
log.set_verbosity(1)
log = logging.getLogger("EasyBuild")

# log levels: NOTSET (default), DEBUG, INFO, WARNING, ERROR, CRITICAL
log.setLevel(logging.INFO)

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

Expand Down

0 comments on commit 13208ea

Please sign in to comment.