InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

Transition remote modules configuration from `setup.py` to the modern `pyproject.toml` #4748

Open jhlegarreta opened 1 week ago

jhlegarreta commented 1 week ago

Description

Transition remote modules configuration from setup.py to the modern pyproject.toml.

Impact analysis

pyproject.toml is the modern way to package projects using Python code: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/ https://packaging.python.org/en/latest/guides/modernize-setup-py-project/#modernize-setup-py-project

Expected behavior

Transition all remote module's project configuration to a pyproject.toml file.

Actual behavior

Almost all remote module's project configuration dwells in a setup.py file.

Versions

N/A.

Environment

N/A.

Additional Information

Matt has contributed with a script that would help in the transition: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/pull/161

Also, there is this tool Matt has used to update the remote module CI config to ITK 5.4: https://github.com/asottile/all-repos

Ongoing work: https://github.com/thewtex/ITK/commit/9e9d5131dcde8f46505c838218df68ce24701cd0

Remotes and PRs:

Notes:

thewtex commented 6 days ago

@jhlegarreta thank you for your help with this! :100: :1st_place_medal:

I did not bump the versions for the remotes while opening the PRs. @thewtex let me know your thoughts. Major, minor, patch, none?

I think we should bump the major version. Experience has shown that the packages are not binary compatible across itk major or minor releases. Following semantic versioning, this is a major bump.

In the process of updating these, we could consider also changing the default branch from master to main,

image

jhlegarreta commented 6 days ago

Re https://github.com/InsightSoftwareConsortium/ITK/issues/4748#issuecomment-2186894767

I am not bumping to newer ITK versions when transitioning to pyproject.toml: I am leaving unmodified the ITK dependency version that is transferred automatically from setup.py to pyproject.toml. Do you want me to require "itk>=5.4" for all of them while adopting pyproject.toml?

In the process of updating these, we could consider also changing the default branch from master to main,

Can do that right after the PRs are merged.

thewtex commented 5 days ago

I am not bumping to newer ITK versions when transitioning to pyproject.toml: I am leaving unmodified the ITK dependency version that is transferred automatically from setup.py to pyproject.toml. Do you want me to require "itk>=5.4" for all of them while adopting pyproject.toml?

Yes, please. itk == 5.4.* to be specific (or itk-core == 5.4.* if it only requires itk-core, etc.) We should update the script to do so automatically, too.

jhlegarreta commented 5 days ago

Yes, please. itk == 5.4. to be specific (or itk-core == 5.4. if it only requires itk-core, etc.) We should update the script to do so automatically, too.

OK, done. The script does update to itk == 5.4.* in most cases (e.g. it does not when no specific version of itk has been specified, for example).

Edit: leaving bumping version of ITKTubeTK to @aylward.