TotalSegmentator icon indicating copy to clipboard operation
TotalSegmentator copied to clipboard

Hard pin on requests in PyPi release for python 3.10

Open marijncv opened this issue 1 year ago • 7 comments

Currently, the release of TotalSegmentator has a hard pin on requests in the version available on PyPi (2.0.5). However, in the setup.py, there is some logic to only set this hard pin when installing with python 3.9. The current release is problematic for us using TotalSegmentator when we are trying to install with python3.10 but are hit with the hard pin on requests that is incompatible with our requirements universe.

Would it be possible to release separate wheels for the package for python versions 3.9 & 3.10, with 3.10 having no hard pin on requests?

Thank you in advance!

marijncv avatar Jan 09 '24 08:01 marijncv

The latest release (v2.0.5) should contain the logic in setup.py which uses a fixed requests only for python <= 3.9. So I do not really understand why your v2.0.5 does not contain this.

wasserth avatar Jan 09 '24 15:01 wasserth

The setup.py logic is only run when installing the source distribution. But there is also a built distribution available (see here), and pip favors the built distribution over source distribution. When looking at the metadata for the built distribution, you can see the hard pin there:

wget https://files.pythonhosted.org/packages/e0/44/c99e5b42c7b567f66692cd0af3ae7cb5b8ddac9d7946853b1fa433a705a3/TotalSegmentator-2.0.5-py3-none-any.whl
unzip TotalSegmentator-2.0.5-py3-none-any.whl -d dist
cat dist/TotalSegmentator-2.0.5.dist-info/METADATA

My guess is that the built distribution was generated from a python3.9 process

marijncv avatar Jan 09 '24 16:01 marijncv

That is correct: I uploaded the pip packages from python 3.9. Do you know how to create built distributions for each python version?

wasserth avatar Jan 10 '24 14:01 wasserth

After digging in some more it looks like there is no need for multiple built distributions, but we can instead make use of inline python constraints for the install_requires parameter as described here. See my PR for a proposal!

marijncv avatar Jan 11 '24 08:01 marijncv

Great. Thanks for the PR. I just merged it.

wasserth avatar Jan 11 '24 13:01 wasserth

Thanks for the merge! Are you planning to release a new version to pypi soon?

marijncv avatar Jan 12 '24 13:01 marijncv

I am planning a new release soon.

wasserth avatar Jan 24 '24 10:01 wasserth