# Note: Install Python 3
# Update pip and install virtualenv (dependency encapsulator) and black (linter; IDE needs to be restarted)
# Note: install Poetry for Linux
# Note: it doesn't matter if you pass it to `python` or `python3`
$: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
# Note: install Poetry for Windows
$: (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
# Note: do NOT update Poetry, it will break itself
$: python get-poetry.py --uninstall
# Note: `.toml` project name and package have to match (protopy; protopy)
$: poetry install # install all dependencies
$: pip install dist/protopy-0.1.0-py3-none.any.whl
$: protopy
$: poetry shell
$: cd docs
# Note: review source/conf.py and source/index.rst
$: make html
# Note: see docs in docs/build/apidocs/index.html
$: poetry run python ./protopy/runner.py
$: poetry run pytest --durations=0
$: poetry run pytest --cov=protopy --cov-report=html tests
#: Note: see coverage report in htmlcov/index.html
Dependencies, Python version and the virtual environment are managed by Poetry
.
$: poetry search Package-Name
$: poetry add Package-Name[==Package-Version]
Define project entry point and metadata.
Configure Python libraries.
$: poetry run black .
$: poetry run python ./protopy/profiler.py
$: poetry build
# Note: get the token from your PiPy account
$: poetry config pypi-token.pypi PyPI-Api-Access-Token
$: poetry publish --build
https://pypi.org/project/protopy/