Skip to content

Commit

Permalink
Update functionality in versioneer.py and setup.py
Browse files Browse the repository at this point in the history
- Updated `SafeConfigParser` to `ConfigParser` in `versioneer.py` to align with Python 3.2+ standards.
- Replaced deprecated `readfp` method with `read_file` in `versioneer.py`.
- Changed import statement to `import sysconfig` in `setup.py`.
- Fixed architecture check condition to verify 64-bit Python in `setup.py`.
- Updated include directories retrieval in `setup.py` to match changes in `sysconfig` API.
  • Loading branch information
ahmedsalim3 committed Sep 13, 2024
1 parent aab3c6f commit 2048382
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env python

from distutils import sysconfig
import sysconfig
import platform

import numpy
from setuptools import Extension, setup
import versioneer

if platform.architecture()[0].startswith('32'):
raise Exception('PyRadiomics requires 64 bits python')
raise Exception('PyRadiomics requires 64 bits python')

commands = versioneer.get_cmdclass()
incDirs = [sysconfig.get_python_inc(), numpy.get_include()]
incDirs = [sysconfig.get_paths()['include'], numpy.get_include()]

ext = [Extension("radiomics._cmatrices", ["radiomics/src/_cmatrices.c", "radiomics/src/cmatrices.c"],
include_dirs=incDirs),
Expand Down
4 changes: 2 additions & 2 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ def get_config_from_root(root):
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
# the top of versioneer.py for instructions on writing your setup.cfg .
setup_cfg = os.path.join(root, "setup.cfg")
parser = configparser.SafeConfigParser()
parser = configparser.ConfigParser()
with open(setup_cfg, "r") as f:
parser.readfp(f)
parser.read_file(f)
VCS = parser.get("versioneer", "VCS") # mandatory

def get(parser, name):
Expand Down

0 comments on commit 2048382

Please sign in to comment.