Humanfirst module package
HelloWorld
- Remove any previously created virtual env
rm -rf ./venv
- Create virtualenv & activate
python3 -m venv venv
- if bash shell
source venv/bin/activate
In case of deactivating use "deactivate" - Update PiP
python -m pip install --upgrade pip
- install requirements
pip install -r requirements.txt --no-cache
Before using pytest
command
rm -rf ./build ./dist
python setup.py sdist bdist_wheel
Packages can be tested using TestPYPI before uploading to PYPI - https://packaging.python.org/en/latest/guides/using-testpypi/
Register in TestPYPI - https://test.pypi.org/account/register/
Enable 2 factor authentication and generate API token using Account settings
keyring set system __token__
It'll prompt for a password - give it the API key Theoretically this stops you having to put in your username and password each time.
Then Enter your TestPYPI API token
twine upload --repository testpypi dist/*
Username: __token__
Password: API token
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ <your-package>
Register in PYPI - https://pypi.org/account/register/
Enable 2 factor authentication and generate API token using Account settings
keyring set system __token__
Then Enter your PYPI API token
twine upload dist/*
Username: __token__
Password: API token
python -m pip install -e ../humanfirst-module/
python3 -m pip install -e .
pip install dist/humanfirst-<version number>.tar.gz --no-cache
or from academy example change the version number and the path...
pip install ../humanfirst-module/dist/humanfirst-1.1.3.tar.gz --no-cache
make sure any last minute build changes committed! pytest in academy