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

Set SimpleITK to 2.0.2, maintain list of packages only in requirements.txt #57

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

Conversation

tashrifbillah
Copy link
Contributor

Hi, proposing this long overdue change--we should maintain the list of packages only in one place i.e. requirements.txt. This allows us to not touch setup.py.

On the other hand, after 3 years, while trying to build HD-BET, we found that it does not build with soft version specification of SimpleITK. Hence, I have hardly specified 2.0.2. I notice that one of your commits already did it that way. But then somebody made it soft. I have just undone the latter.

tashrifbillah and others added 6 commits October 29, 2021 17:27
Let setup.py parse requirements.txt
Pull latest changes from MIC-DKFZ/HD-BET
Since HD-BET development, SimpleITK progressed a lot. The previous >= setting pulls 2.3.0 which does not install sucessfully with the rest of the requirements.
This commit correctly sets SimpleITK==2.0.2
MIC-DKFZ@87226b1
(Not sure why it was set to >= afterward)
@@ -1,5 +1,4 @@
numpy>=1.14.5
torch>=0.4.0
scikit-image>=0.14.0
SimpleITK>=2.0.2
-e git+https://github.com/MIC-DKFZ/batchgenerators#egg=batchgenerators
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was syntactically incorrect. We do not need it anyway because this function has been copied over:

def resize_segmentation(segmentation, new_shape, order=3, cval=0):

@@ -1,5 +1,4 @@
numpy>=1.14.5
torch>=0.4.0
scikit-image>=0.14.0
SimpleITK>=2.0.2
-e git+https://github.com/MIC-DKFZ/batchgenerators#egg=batchgenerators
SimpleITK==2.0.2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soft version specification no longer works because of progress of SimpleITK ever since. So I did hard specification.

@ebrahimebrahim
Copy link
Contributor

Hi, please see my proposal in #56 in which we get rid of setup.py and requirements.txt in favor of pyproject.toml. The proposal is to do this in order support publishing the package, which will make it much easier to install and also make it possible to use as a dependency in other published work. With that change it will also be possible to add unit tests that can detect issues like the one caused by the progress of SimpleITK.

The hard specification that you have here can be done inside the pyproject.toml.

Do you know if the maintainers of this project are interested in something like #56?

@tashrifbillah
Copy link
Contributor Author

Do you know if the maintainers of this project are interested in something like #56?

I know I am not interested as 56 introduces complexity to a simple project and makes it hard for successors to maintain it. So it should be kept as is with my modification.

@ebrahimebrahim
Copy link
Contributor

Fair opinion :)

The complexity automates a lot of the maintenance tasks. The project becomes easier to maintain. Publishing makes it possible to pip install the project directly.

@jcfr
Copy link

jcfr commented Jun 11, 2024

@tashrifbillah Thanks for the feedback! 🙏

As you mentioned, ensuring the project's maintainability over time is crucial. 🚀

Additionally, we should base the project's infrastructure and continuous integration on modern best practices. This will streamline the contribution process, testing, and distribution.

I believe @ebrahimebrahim's proposal addresses this effectively. By leveraging a well-maintained and tested template, it adopts best practices already in use in hundreds of projects. This approach ensures that users can install and use the project seamlessly via Python wheels1 without needing to install development tools locally.

These best practices are detailed in the development guides available at https://scientific-python.org/.

It's also important to note that our current infrastructure, including your proposed changes, relies on setup.py, which is now considered obsolete. We should transition to using a pyproject.toml2 file instead.

Footnotes

  1. https://packaging.python.org/en/latest/specifications/binary-distribution-format/#binary-distribution-format

  2. https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/

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.

3 participants