ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
608 stars 161 forks source link

COMP: Add support for Python 3.12 #510

Closed ravnoor closed 7 months ago

ravnoor commented 9 months ago

All tests passing and building successfully:

Wheels (and detailed logs) can be found here: https://cirrus-ci.com/build/5424545834729472

I haven't tested the amd64 wheels for Windows/Linux/MacOS due to concurrency limits on Cirrus CI, but GitHub Actions should fill in the gap.

ravnoor commented 9 months ago

@cookpa @stnava @ntustison I have left py37 in the GitHub CI workflow for now, but it probably should be removed since it's been EOL for 4 months now. Besides, cibuildwheel==2.16.2 requires py38 or higher

ntustison commented 9 months ago

Awesome. Thanks for this. Currently away so I'll defer to @cookpa or @stnava for merging.

cookpa commented 8 months ago

Hi, sorry for the delay in getting to this. I'm happy to remove Python 3.7

ravnoor commented 7 months ago

Hi, sorry for the delay in getting to this. I'm happy to remove Python 3.7

Done, and all checks passing

cookpa commented 7 months ago

Thanks for doing this @ravnoor - I'm re-running the failed windows build now. It randomly fails sometimes and I have not been able to figure out why

stnava commented 7 months ago

apologies - but can you guys remind me what's needed for getting wheels on pypi ? I think last time I just downloaded them from GitHub then pushed them to pypi .... I am happy to add whoever to pypi "management" team if you have accounts there.

cookpa commented 7 months ago

Oh yes I should look into PyPI. I got a bunch of errors about that last time I ran a release action. I think it authenticated but couldn't find the wheels, possibly a simple fix. I think it just needs to point to the individual wheel subdirs

Notice: Using a user-provided API token for authentication against https://upload.pypi.org/legacy/
Warning: Trusted Publishers allows publishing packages to PyPI from automated environments like GitHub Actions without needing to use username/password combinations or API tokens to authenticate with PyPI. Read more: https://docs.pypi.org/trusted-publishers
Warning:  It looks like there are no Python distribution packages to publish in the directory './wheelhouse/'. Please verify that they are in place should you face this problem.
Showing hash values of files to be uploaded:
Traceback (most recent call last):
/github/workspace/wheelhouse/cp37-manylinux_x86_64

  File "/app/print-hash.py", line 17, in <module>
    content = file_object.read_bytes()
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/pathlib.py", line 1050, in read_bytes
    with self.open(mode='rb') as f:
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/pathlib.py", line 1044, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: '/github/workspace/wheelhouse/cp37-manylinux_x86_64'
ravnoor commented 7 months ago

Thanks for doing this @ravnoor - I'm re-running the failed windows build now. It randomly fails sometimes and I have not been able to figure out why

I have seen GHA jobs randomly fail for no apparent reason. This failure seems like one of those. Tests all passed OK, so I counted it as a pass.

ravnoor commented 7 months ago

apologies - but can you guys remind me what's needed for getting wheels on pypi ? I think last time I just downloaded them from GitHub then pushed them to pypi .... I am happy to add whoever to pypi "management" team if you have accounts there.

@stnava @cookpa I can take a more in-depth look at this. I was able to get TestPyPI to work to the point where everything but the upload worked since I don't have access to the project on test.pypi.org. If you can generate an API token or delegate access, I can test it end-to-end, and then push the same changes for PyPI.

stnava commented 7 months ago

I invited @ravnoor as a manager on pypi

ravnoor commented 7 months ago

@ravnoor was already taken, unfortunately. I'm @rvnr on PyPI

ravnoor commented 7 months ago

Looks like I've the PyPI uploads figured out. I'll clean it up and make a new PR.

In past conversations, I recall discussing the limit for uploading packages to PyPI. What is it exactly? This may limit how many builds across platforms (linux,macosx,win) and architectures (x86_64,arm64) and python versions (py38-py312) we could upload.

To accommodate all, we would need 6700 MB [5 python versions x 1340] per version/release.

Based on the most recent build, here's a break down of the build sizes: os_arch size (MB)
macosx_x86_64 310
macosx_arm64 194
manylinux_x86_64 330
manylinux_aarch64 329
win_amd64 177
TOTAL 1340 MB

Is there a consensus on what to include/exclude? @stnava @ntustison @cookpa

From the CI perspective, a simple regex can enforce the upload inclusions/exclusion.

stnava commented 7 months ago

these is the current information from pypi:

stnava commented 7 months ago

I think based on your numbers, we could request increases for pypi quotas for both total project size and upload limit.

ravnoor commented 7 months ago

Yes, an increase would make sense to future-proof against hitting any quota limits