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 install-ability #9

Merged
merged 6 commits into from
May 25, 2023
Merged

pypi install-ability #9

merged 6 commits into from
May 25, 2023

Conversation

ACEnglish
Copy link
Contributor

@ACEnglish ACEnglish commented May 24, 2023

Hello,

Turns out there was more to be done. The tl;dr; is that we still need a shim setup.py, and a few other things changed.

When I tried to install pywfa for a package feature I'm testing, the github action that tests my package wasn't able to successfully install pywfa==0.4.2. I was getting an error that pywfa was named "UNKNOWN-0.0.0"

full error
WARNING: Generating metadata for package pywfa produced metadata for project name unknown. Fix your #egg=pywfa fragments.
Discarding https://files.pythonhosted.org/packages/5d/92/366a9f0a0a4b34e2650199861a377eddf7e9f24ecc5298efb81352dc7cee/pywfa-0.4.2.tar.gz#sha256=065c782aa917da52c947a7ea1ed9d0e0153325153f7fcc32cca588f08e58136b (from https://pypi.org/simple/pywfa/) (requires-python:>=3.7): Requested unknown from https://files.pythonhosted.org/packages/5d/92/366a9f0a0a4b34e2650199861a377eddf7e9f24ecc5298efb81352dc7cee/pywfa-0.4.2.tar.gz#sha256=065c782aa917da52c947a7ea1ed9d0e0153325153f7fcc32cca588f08e58136b has inconsistent name: filename has 'pywfa', but metadata has 'unknown'

I also needed to fix the MANIFEST.in to include the _custom_build.py and Makefile in pywfa/WFA2_lib/*. Also, the new _custom_build.py has a check to ensure that the make command works. However, the make command never exited non-zero due to only returning the status of the final command (was cd pywfa/WFA2_lib; make .. ; cd ../).

I believe these changes should work better because I was able to get python3 setup.py sdist to create a valid, usable python3 -m pip install dist/pywfa-0.5.0.dev1.tar.gz. And by having the shim, things like pip install -e seem to work. Furthermore, I successfully tested by editing my github action to pull directly via: python3 -m pip install 'pywfa @ git+https://github.com/ACEnglish/pywfa'. Which is great, but I don't know if this is a great emulation of what pypi will make.

Finally, I bumped the version to 0.5.0-dev. At least once trying to install 0.4.2 failed and pip slyly installed 0.4.1 instead (which had caused the old undefined symbol: wavefront_align). I'm guessing that bumping the minor version instead of the patch may prevent this.

I don't know your workflow for distributing to pypi, but if possible, could you try a test.pypi.org upload before pushing to regular pypi? If there's more problems, we'll at least not be filling it up with my mistakes lol.

Have a great day,
~/Adam English

* setup.py shim is needed to prevent "UNKNOWN-0.0.0" eggs
* Manifest wasn't including `pywfa/WFA2_lib/*` so Makefiles etc were being dropped
* Manifest now also pulls in the `_custom_build.py`
* `python3 setup.py sdist` works
* `_custom_build.py` command was always returning retcode 0 due to final `cd ../`. Can now catch make fails
* `python3 -m pip install -e .` now works
* bumping version to 0.5 since at least once I saw pip silently replace 0.4.2 with 0.4.1
left intermediate, non-working lines commented out in the code
including removing -dev from version
@kcleal
Copy link
Owner

kcleal commented May 25, 2023

Thanks again, it seems there are so many traps to fall in to. I tested this PR on testPypi and it seemed to work fine. Happy to merge and put on pypi

@kcleal kcleal merged commit aa2e6a4 into kcleal:master May 25, 2023
@ACEnglish
Copy link
Contributor Author

Looks like it works! Thanks for putting this out there.

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 this pull request may close these issues.

2 participants