Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor build system #898

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

JoostJM
Copy link
Collaborator

@JoostJM JoostJM commented Jan 28, 2025

Major refactoring of the build system and CI workflows to get PyRadiomics up-to-date with the latest conventions.

  • Use Github actions for CI/CD.
  • Define metadata as much as possible in pyproject.toml
  • Use SciKit build as the build system, removes setup.py and associated files.
  • Uses Cmake to build the extensions.
  • Remove versioneer for dynamic versioning based on github tags (now uses setuptools-scm.

- Remove setup.cfg
- Move as much information as possible to pyproject.toml
- Keep versioning dynamic using versioneer.
Follows suggestions obtained by running cookiecutter from https://learn.scientific-python.org/development/.
- Update the matrices baseline numpy arrays to newer version. Values are unchanged, matrices were simply loaded and saved again using `arr = numpy.load(<path>); numpy.save(<path>, arr);`.
- Ignore specific deprecation warning related to a deprecated function being used in PyKwalify. See also Grokzen/pykwalify#202 and Grokzen/pykwalify#203.
- Excludes github config from `.github`.
- Excludes `.*` files in the root.
Also remove deprecated requirements files (now defined in `pyproject.toml`.
For migration purposes, also add the `refactor-build-system` branch to the push event of the CI workflow.
Due to migration being in progress, the pre-commit job is expected to fail. Error occurring in this job are scheduled to be fixed after CI setup is up and running to catch bugs that arise due to style changes.
@JoostJM JoostJM force-pushed the refactor-build-system branch from 5c7e5f4 to f2f3c6b Compare January 29, 2025 09:11
jcfr and others added 4 commits January 29, 2025 08:00
This commit fixes the following error:

```
$ pip install .[test]
[...]
      *** Making wheel...
      2025-01-29 09:11:34,654 - scikit_build_core - ERROR - Metadata mismatch in METADATA: b'Metadata-Version: 2.1\nName: pyradiomics\nVersion: 3.0.1a4.dev38+gf2f3c6b\nSummary: Radiomics features library for python\nKeywords: radiomics,cancerimaging,medicalresearch,computationalimaging\nAuthor-Email: PyRadiomics Community <[email protected]>\n[...]'
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-u6dnfh2j/overlay/lib/python3.9/site-packages/scikit_build_core/build/__init__.py", line 33, in build_wheel
          return _build_wheel_impl(
        File "/tmp/pip-build-env-u6dnfh2j/overlay/lib/python3.9/site-packages/scikit_build_core/build/wheel.py", line 175, in _build_wheel_impl
          return _build_wheel_impl_impl(
        File "/tmp/pip-build-env-u6dnfh2j/overlay/lib/python3.9/site-packages/scikit_build_core/build/wheel.py", line 508, in _build_wheel_impl_impl
          raise AssertionError(msg)
      AssertionError: Metadata mismatch in METADATA
[...]
```
CI: Fix wheel generation renaming _version.py to _version.pyi
Supports Python versions 3.8-3.10. 3.11+ fails with segmentation fault, most likely due to new multithreading support.
@JoostJM JoostJM force-pushed the refactor-build-system branch from 75cd3de to ce5378c Compare January 29, 2025 14:02
Fails CI because of an error during a build of SimpleITK (apparently no appropriate wheel available).
Allows to exclude commits from git-blame. This should contain commits reflecting only style changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants