- python3
- pip3
- virtualenv
pip3 install virtualenv
- Create a python3 virtual environment
virtualenv .venv -p python3
- Activate the virtual environment created in step 1
source .venv/bin/activate - Install
setuptoolsto package code andblackto format python codepip3 install setuptools black
- Install libraries in file requirements.txt
pip3 install -r requirements.txt
- Run command to install CLI in editable mode
pip3 install -e . - Verify the CLI
which aito
- Run
aitocommandaito
-
Install
buildto generate distribution packages andtwineto distribute package to PyPIpip3 install build twine
-
Run
buildcommand as the root folder, where filepyproject.tomlis locatedrm -rf dist python3 -m build
After that command, we will have
tar.gzand.whlfiles indistfolder -
Register an account in PyPI and create an API token with
Entire accountscope -
Using twine to upload the distribution packages created in step 2 to TestPyPI
twine upload --skip-existing dist/*--skip-existingif we want to distribute further versions of the cli.You will be prompted for a username and password. For the username, use
__token__. For the password, use the token value, including the pypi- prefix. -
Using another virtual environment and install the
aitomaticusing pip to verify that it worksdeactivate virtualenv .venv-test -p python3 source .venv-test/bin/activate pip3 install aitomatic