nikolasibalic / ARC-Alkali-Rydberg-Calculator

Object-oriented Python library for computation of properties of highly-excited Rydbeg states of alkali and divalent atoms.
https://atomcalc.org
BSD 3-Clause "New" or "Revised" License
90 stars 78 forks source link

Packaging updates #167

Closed dihm closed 4 months ago

dihm commented 4 months ago

Fixes #166

This PR modernizes the packaging for ARC, allowing to be PEP-517 compliant and fixing some other deprecations in the build process. It fully implements a pyproject.toml description file that contains all meta-data as well as install and setup requirements.

Note that the new build process uses isolated build environments using PyPA's build or via pip.

I've confirmed basic operation, but more thorough checks are warranted to ensure meta data hasn't been lost or package functionality is not fundamentally broken somehow.

socket-security[bot] commented 4 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/arc@1.0 None 0 36 kB charlex

View full report↗︎

dihm commented 4 months ago

Regarding osx-arm64 builds, since v3.4.1 ARC technically already has them via the universal2 package standard. This is because the macos-latest runner was recently updated by github to run on M1 hardware, and the default python installed by the setup-python action uses the universal2 "architecture" (which includes both x64 and arm64 binaries).

This is probably good enough, though it should be noted that scipy packages (numpy, scipy, matplotlib, etc) have chosen not to use universal2 and instead build each architecture individually. There may or may not be a good reason behind that, but I'll have to test on an M1 mac to see if it matters.

Final question: is there a particular reason you don't distribute wheels for linux? It would be fairly easy to add to the workflows.

dihm commented 4 months ago

I have confirmed that the universal2 builds work for M1 macs (in both normal python installs and conda python). I'm inclined to leave things as is in that regard.

I've also confirmed the build source tarballs are identical (up to intended changes), and the built wheels install functional packages.

dihm commented 4 months ago

That is interesting. I thought my change would install the package with pip during the docs build, pulling the requirements from the project.toml that way and reducing the amount of redundant information.

But I didn't think too hard about it and RTD has a mind of its own when it comes to these things.

Apologies for the incomplete solution.

nikolasibalic commented 4 months ago

I have updated CI workflow (#168 ) so that it uses build wheels action used by scipy and numpy projects. So now we have wheels for Linux, and for Mac (and Mac ones are separated by architecture; should be better in principle).

Everything is released now as ver 3.5.0. I hope with new build system the installation will be smoother.

Thank you for your contribution @dihm !