-
Notifications
You must be signed in to change notification settings - Fork 106
Maintainers Build Test and Distribute
Sumio Kiyooka edited this page May 3, 2021
·
3 revisions
You should be using virtualenv, virtrualenvwrapper to make things easy on yourself.
Ref: Packaging Python Projects Tutorial
Final steps:
- Update and commit blackduck/__version__.py
- Tag the release e.g. git tag -a 1.0.2 -m "Release 1.0.2"
- git push
- git push --tags
To build both the source distribution package and the wheel package:
pip3 install -r requirements.txt
python3 setup.py sdist bdist_wheel
Using pytest
git clone https://github.com/blackducksoftware/hub-rest-api-python.git
cd hub-rest-api-python
# optional but advisable: create/use virtualenv
# you should have 3.x+, e.g. Python 3.7.0
pip3 install -r requirements.txt
pip3 install .
cd test
pytest
Requires you have an account on either/both PyPi and Test PyPi AND you must be a package maintainer.
Send a request to [email protected] or [email protected] if you want to be listed as a package maintainer.
Upload to Test PyPI:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Then try installing it from Test PyPI
Uninstall all packages:
pip freeze > req.txt
pip uninstall -r req.txt -y
rm req.txt
pip list (ensure just pip and setuptools are installed)
Install:
pip install --index-url https://test.pypi.org/simple blackduck
Upload to PyPI:
twine upload dist/*
Then try installing it from PyPI
pip3 install blackduck
Do this when testing a new version.
git clone https://github.com/blackducksoftware/hub-rest-api-python.git
cd hub-rest-api-python
pip3 install -r requirements.txt
pip3 install .
pip3 uninstall blackduck