Question: How to test that PyPi install will work before pushing to PyPi? (Python)


How to test that PyPi install will work before pushing to PyPi? (Python)

Answers 1
Added at 2016-12-12 04:12

I have been having some issues figuring out how to get my Python package processed up to PyPi so I can install it easily with other dependencies for other projects (ie. with a requirements entry or a simple 'pip install xyz') - one such is listed here Creating PyPi package - Could not find a version that satisfies the requirement iso8601. This led me down another rabbit hole which led to another question:

How can I test to make sure the my pip install command will work prior to pushing my package with a release to PyPi?

nr: #1 dodano: 2016-12-12 04:12

If you just need to test whether pip install works from the built package, you can create it and then use pip to install it from local filesystem.

python sdist
pip install dist/mypackage-1.0.tar.gz

If you have been running python install already, ensure you run:

pip uninstall mypackage

to uninstall existing package first. You can encounter strange situations where mixing python install and pip locally, so run pip uninstall multiple times until says no more package to remove to be safe.

Source Show
◀ Wstecz