pex-tool / pex

A tool for generating .pex (Python EXecutable) files, lock files and venvs.
https://docs.pex-tool.org/
Apache License 2.0
2.5k stars 257 forks source link

Fix PyPI deploy. #2364

Closed jsirois closed 5 months ago

jsirois commented 5 months ago

The v2.1.164 release went smoothly except for the PyPI deploy. I had to build and deploy manually from the v2.1.164 tag with:

$ rm -rf dist/
$ tox -epackage -- \
--additional-format sdist \
--additional-format wheel \
--embed-docs
$ pex twine -c twine -- upload -s dist/*

The action wants the dist/ dir to just contain the artifacts to deploy; no more and no less.

jsirois commented 5 months ago

This is new due to the new --embed-docs, which causes html docs to be generated to dist/docs/html prior to building the wheel as part of the embedding machinery that enables pex3 docs for local offline docs.

So you now get:

dist/
    docs/
    pex-2.1.164.tar.gz
    pex-2.1.164-py2.py3-none-any.whl

And https://github.com/marketplace/actions/pypi-publish tries to publish everything in dist/ with no knobs to control inclusion or exclusion and publishing docs/ to PyPI fails as it should. The action realizes this as part of a pre-check it does though, failing the whole step with nothing being published. Thus the step I documented in the OP to right the ship for 2.1.164 worked (i.e.: thankfully that action is all or nothing).