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

pypi release github workflow failure #164

Closed
rabernat opened this issue Aug 29, 2021 · 8 comments · Fixed by #165
Closed

pypi release github workflow failure #164

rabernat opened this issue Aug 29, 2021 · 8 comments · Fixed by #165

Comments

@rabernat
Copy link
Collaborator

https://github.com/xgcm/xrft/runs/3450436194?check_suite_focus=true

``` Run python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel twine upload dist/* shell: /usr/bin/bash -e {0} env: pythonLocation: /opt/hostedtoolcache/Python/3.9.6/x64 TWINE_USERNAME: *** TWINE_PASSWORD: *** /opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/setuptools/dist.py:642: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running sdist running egg_info creating xrft.egg-info writing xrft.egg-info/PKG-INFO writing dependency_links to xrft.egg-info/dependency_links.txt writing requirements to xrft.egg-info/requires.txt writing top-level names to xrft.egg-info/top_level.txt writing manifest file 'xrft.egg-info/SOURCES.txt' adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*') reading manifest template 'MANIFEST.in' writing manifest file 'xrft.egg-info/SOURCES.txt' running check creating xrft-0+untagged.0.g744209f creating xrft-0+untagged.0.g744209f/.github creating xrft-0+untagged.0.g744209f/.github/workflows creating xrft-0+untagged.0.g744209f/ci creating xrft-0+untagged.0.g744209f/doc creating xrft-0+untagged.0.g744209f/xrft creating xrft-0+untagged.0.g744209f/xrft.egg-info creating xrft-0+untagged.0.g744209f/xrft/tests copying files to xrft-0+untagged.0.g744209f... copying .gitattributes -> xrft-0+untagged.0.g744209f copying .gitignore -> xrft-0+untagged.0.g744209f copying .pre-commit-config.yaml -> xrft-0+untagged.0.g744209f copying LICENSE -> xrft-0+untagged.0.g744209f copying MANIFEST.in -> xrft-0+untagged.0.g744209f copying README.rst -> xrft-0+untagged.0.g744209f copying appveyor.yml -> xrft-0+untagged.0.g744209f copying codecov.yml -> xrft-0+untagged.0.g744209f copying readthedocs.yml -> xrft-0+untagged.0.g744209f copying setup.cfg -> xrft-0+untagged.0.g744209f copying setup.py -> xrft-0+untagged.0.g744209f copying versioneer.py -> xrft-0+untagged.0.g744209f copying .github/workflows/ci.yaml -> xrft-0+untagged.0.g744209f/.github/workflows copying .github/workflows/linting.yaml -> xrft-0+untagged.0.g744209f/.github/workflows copying .github/workflows/pythonpublish.yaml -> xrft-0+untagged.0.g744209f/.github/workflows copying ci/environment-py3.6.yml -> xrft-0+untagged.0.g744209f/ci copying ci/environment-py3.7.yml -> xrft-0+untagged.0.g744209f/ci copying ci/environment-py3.8.yml -> xrft-0+untagged.0.g744209f/ci copying doc/DFT-iDFT_example.ipynb -> xrft-0+untagged.0.g744209f/doc copying doc/MITgcm_example.ipynb -> xrft-0+untagged.0.g744209f/doc copying doc/Makefile -> xrft-0+untagged.0.g744209f/doc copying doc/Parseval_example.ipynb -> xrft-0+untagged.0.g744209f/doc copying doc/api.rst -> xrft-0+untagged.0.g744209f/doc copying doc/chunk_example.ipynb -> xrft-0+untagged.0.g744209f/doc copying doc/conf.py -> xrft-0+untagged.0.g744209f/doc copying doc/contributor_guide.rst -> xrft-0+untagged.0.g744209f/doc copying doc/environment.yml -> xrft-0+untagged.0.g744209f/doc copying doc/index.rst -> xrft-0+untagged.0.g744209f/doc copying doc/installation.rst -> xrft-0+untagged.0.g744209f/doc copying doc/limitations.rst -> xrft-0+untagged.0.g744209f/doc copying doc/make.bat -> xrft-0+untagged.0.g744209f/doc copying doc/whats-new.rst -> xrft-0+untagged.0.g744209f/doc copying doc/why-xrft.rst -> xrft-0+untagged.0.g744209f/doc copying xrft/__init__.py -> xrft-0+untagged.0.g744209f/xrft copying xrft/_version.py -> xrft-0+untagged.0.g744209f/xrft copying xrft/detrend.py -> xrft-0+untagged.0.g744209f/xrft copying xrft/xrft.py -> xrft-0+untagged.0.g744209f/xrft copying xrft.egg-info/PKG-INFO -> xrft-0+untagged.0.g744209f/xrft.egg-info copying xrft.egg-info/SOURCES.txt -> xrft-0+untagged.0.g744209f/xrft.egg-info copying xrft.egg-info/dependency_links.txt -> xrft-0+untagged.0.g744209f/xrft.egg-info copying xrft.egg-info/requires.txt -> xrft-0+untagged.0.g744209f/xrft.egg-info copying xrft.egg-info/top_level.txt -> xrft-0+untagged.0.g744209f/xrft.egg-info copying xrft/tests/__init__.py -> xrft-0+untagged.0.g744209f/xrft/tests copying xrft/tests/test_detrend.py -> xrft-0+untagged.0.g744209f/xrft/tests copying xrft/tests/test_xrft.py -> xrft-0+untagged.0.g744209f/xrft/tests Writing xrft-0+untagged.0.g744209f/setup.cfg UPDATING xrft-0+untagged.0.g744209f/xrft/_version.py set xrft-0+untagged.0.g744209f/xrft/_version.py to '0+untagged.0.g744209f' creating dist Creating tar archive removing 'xrft-0+untagged.0.g744209f' (and everything under it) running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/xrft copying xrft/detrend.py -> build/lib/xrft copying xrft/__init__.py -> build/lib/xrft copying xrft/xrft.py -> build/lib/xrft copying xrft/_version.py -> build/lib/xrft creating build/lib/xrft/tests copying xrft/tests/test_detrend.py -> build/lib/xrft/tests copying xrft/tests/__init__.py -> build/lib/xrft/tests copying xrft/tests/test_xrft.py -> build/lib/xrft/tests UPDATING build/lib/xrft/_version.py set build/lib/xrft/_version.py to '0+untagged.0.g744209f' installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/xrft copying build/lib/xrft/detrend.py -> build/bdist.linux-x86_64/wheel/xrft copying build/lib/xrft/__init__.py -> build/bdist.linux-x86_64/wheel/xrft copying build/lib/xrft/xrft.py -> build/bdist.linux-x86_64/wheel/xrft copying build/lib/xrft/_version.py -> build/bdist.linux-x86_64/wheel/xrft creating build/bdist.linux-x86_64/wheel/xrft/tests copying build/lib/xrft/tests/test_detrend.py -> build/bdist.linux-x86_64/wheel/xrft/tests copying build/lib/xrft/tests/__init__.py -> build/bdist.linux-x86_64/wheel/xrft/tests copying build/lib/xrft/tests/test_xrft.py -> build/bdist.linux-x86_64/wheel/xrft/tests running install_egg_info Copying xrft.egg-info to build/bdist.linux-x86_64/wheel/xrft-0+untagged.0.g744209f-py3.9.egg-info running install_scripts adding license file "LICENSE" (matched pattern "LICEN[CS]E*") creating build/bdist.linux-x86_64/wheel/xrft-0+untagged.0.g744209f.dist-info/WHEEL creating 'dist/xrft-0+untagged.0.g744209f-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'xrft/__init__.py' adding 'xrft/_version.py' adding 'xrft/detrend.py' adding 'xrft/xrft.py' adding 'xrft/tests/__init__.py' adding 'xrft/tests/test_detrend.py' adding 'xrft/tests/test_xrft.py' adding 'xrft-0+untagged.0.g744209f.dist-info/LICENSE' adding 'xrft-0+untagged.0.g744209f.dist-info/METADATA' adding 'xrft-0+untagged.0.g744209f.dist-info/WHEEL' adding 'xrft-0+untagged.0.g744209f.dist-info/top_level.txt' adding 'xrft-0+untagged.0.g744209f.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Uploading distributions to https://upload.pypi.org/legacy/ Uploading xrft-0+untagged.0.g744209f-py3-none-any.whl

0%| | 0.00/31.4k [00:00<?, ?B/s]
26%|██▌ | 8.00k/31.4k [00:00<00:00, 60.3kB/s]
100%|██████████| 31.4k/31.4k [00:00<00:00, 81.7kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
'0+untagged.0.g744209f' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.
Error: Process completed with exit code 1.

</details>

The problem is that the workflow environment is not getting the proper version number from the package.

I definitely remember a similar problem cropping up somewhere else, but I can't remember where!

@rabernat
Copy link
Collaborator Author

Ok, now I remember, it was this: pangeo-forge/pangeo-forge-recipes#127 (comment)

Which we solved via:

I suspect that this related to the fact that we are still using versioneer for versioning. Versioneer is no longer maintained and we should probably switch to setuptools scm.

@roxyboy
Copy link
Member

roxyboy commented Aug 31, 2021

Ok, now I remember, it was this: pangeo-forge/pangeo-forge-recipes#127 (comment)

Which we solved via:

I suspect that this related to the fact that we are still using versioneer for versioning. Versioneer is no longer maintained and we should probably switch to setuptools scm.

I've never understood the niddy griddies of managing versions but in order to switch from versioneer, do I just uninstall it, delete versioneer.py and then follow the instructions for setuptools_scm?

@rabernat
Copy link
Collaborator Author

I've never understood the niddy griddies of managing versions but in order to switch from versioneer, do I just uninstall it, delete versioneer.py and then follow the instructions for setuptools_scm?

Yes, that sounds about right. You'll have to do some trial and error. It's probably going to be a pain in the neck.

In both systems, the version is determined from the git tag, so when you're done with this refactor, the version number should not change.

@rabernat
Copy link
Collaborator Author

Alternatively, we could keep versioneer and you could look hard at the error message and try to understand what's going wrong.

@roxyboy
Copy link
Member

roxyboy commented Aug 31, 2021

Considering that versioneer is no longer maintained (such a bummer), I think it would be wise to try to refactor xrft for setuptools_scm... I'll give a try.

@rabernat
Copy link
Collaborator Author

Cool. One thing you can do while debugging the CI is to make a bunch of "release candidate" (RC) releases, rather than continuing to bump the version.

@rabernat
Copy link
Collaborator Author

rabernat commented Sep 1, 2021

So now we are in the same place we were in with Pangeo Forge. setuptools-scm produces the correct version locally but the wrong one inside the github workflow. This is the same issue described in pangeo-forge/pangeo-forge-recipes#127 (comment). Hopefully it has the same fix. @TomAugspurger is the one who sorted it out there, but I wouldn't expect him to chime in here (very busy). Maybe we can retrace the steps he took by looking closely at pangeo-forge-recipes.

@TomAugspurger
Copy link

TomAugspurger commented Sep 1, 2021

Some breadcrumbs:

I think all of those were sufficient to fix the version issue. I don't recall what exactly was necessary. It might be worth checking if the toml package is available on GitHub actions / wherever the tag is being set first.

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 a pull request may close this issue.

3 participants