Publish uwtools releases to PyPI - #969
Conversation
|
|
||
| . $(dirname ${BASH_SOURCE[0]})/common.sh | ||
| ci_conda_activate | ||
| unset CONDEV_SHELL |
There was a problem hiding this comment.
setup.py omits install_requires when CONDEV_SHELL is set, and we need that info to get the Requires-Dist data.
There was a problem hiding this comment.
I'm pretty ignorant about how wheels are built: If install_requires is enabled, does the wheel still contain only the uwtools code, and not the code from dependency packages? I'd hope that the uwtools wheel just contains the uwtools code, plus metadata that tells it what other wheels to install along with it.
There was a problem hiding this comment.
Correct, the wheel contains the uwtools package, and install_requires adds the metadata.
| permissions: | ||
| id-token: write |
There was a problem hiding this comment.
This enables GitHub OIDC for Trusted Publishing.
maddenp-cu
left a comment
There was a problem hiding this comment.
If anything goes wrong at release time, it's easy to remove conda packages from our ufs-community channel and re-run the release workflow without incrementing versions. Not so easy with PyPI, of course. 🤞
|
|
||
| . $(dirname ${BASH_SOURCE[0]})/common.sh | ||
| ci_conda_activate | ||
| unset CONDEV_SHELL |
There was a problem hiding this comment.
I'm pretty ignorant about how wheels are built: If install_requires is enabled, does the wheel still contain only the uwtools code, and not the code from dependency packages? I'd hope that the uwtools wheel just contains the uwtools code, plus metadata that tells it what other wheels to install along with it.
| - name: Make PyPI Package | ||
| run: .github/scripts/pypi-package-build.sh |
There was a problem hiding this comment.
Does the PyPI package build run any tests? I guess not. Would it be a good idea to move this step below the conda Make Package step, in that the conda package build will run all the tests and so, if it fails, this workflow won't bother building the wheel? I think the workflow is already safe in that it won't publish to PyPI if the conda build/publish fails, but it might save a little bit of CI time to not even try to build the wheel if we can't build the conda package.
There was a problem hiding this comment.
Good call. I moved it.
Synopsis
Testing: I did a test on my fork (see PR here) and successfully published a package to TesPyPI, which you can try out here. I installed it locally, and confirmed it was working and that
ecflowwas excluded fromuw --help.Documentation still needs to be written, but I don't feel I'm in a position to write it until it actually exists on PyPI.
Type
Impact
Checklist