AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.15k stars 495 forks source link

Update functionality in `versioneer.py` and `setup.py` #891

Open ahmedsalim3 opened 3 weeks ago

ahmedsalim3 commented 3 weeks ago

So, I've been using radiomics in an image segmentation project and had to install it from source. I made two key changes:

1. versioneer.py file

Update for `SafeConfigParser` Deprecation In the `versioneer.py` file, I updated the use of `SafeConfigParser`. The `SafeConfigParser` class has been renamed to [`ConfigParser`](https://github.com/python/cpython/blob/b1d6f8a2ee04215c64aa8752cc515b7e98a08d28/Lib/configparser.py#L1243). From Python 3.2 and above, `ConfigParser` should be used directly. ```python /usr/lib/python3.9/site-packages/nitrate/config.py:273: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead. parser = ConfigParser.SafeConfigParser() -- Docs: https://docs.pytest.org/en/stable/warnings.html ```
Update for `readfp` Deprecation The `readfp` method has been removed in future versions. It now supports the [`parser.read_file()`](https://github.com/python/cpython/blob/b1d6f8a2ee04215c64aa8752cc515b7e98a08d28/Lib/configparser.py#L755) method. ```python telemetryconfig.py:46: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead. self.config_parser.readfp(f) ```

2. setup.py file

  1. Updated the import statement to use import sysconfig.
  2. Fixed the if statement condition.
  3. Updated the include directories retrieval to reflect changes in the sysconfig API.