Once poetry is installed:
poetry config virtualenvs.in-project true
setting to create a .venv dir in your project and install dependencies there (similar to.bundle/install
)- Clone this repo, cd into it
pyenv local 3.7.4
poetry install
:- add
--no-dev
flag if don't want development requirements - add
--no-root
if don't want to install the current project
- add
poetry run pre-commit install
install git hookspoetry run pre-commit run --all-files
run pre-commit through poetrypoetry add [package]
adds package as dependency, specify--dev
flag if dev dependencypoetry shell
enter a virtual environment through poetry
Tox will create seperate virtual environments for testing with different python versions. A tox.ini
file should like like this in the root directory of your project.
[tox]
isolated_build = true
envlist = python3.6, python3.8
[testenv]
whitelist_externals = poetry
commands =
poetry install -v
poetry run pytest tests/
poetry run pre-commit run -a
Then you should be able to do the following:
git clone ...my-repo...
cd my-repo
poetry run tox
- Merge all branches into develop, make sure tests pass
- Update the version (assume version is 0.1.2):
poetry version 0.1.2
- Update the version test file (i.e. my-repo/tests/test_version.py) to match the above version
- Make sure tests pass:
poetry run tox
- Merge develop into main (previously, master), make sure tests pass
- Create a tag:
git tag 0.1.2
- Build:
poetry build
- Publish
poetry publish
(this will push to pypi) - Create a new release on the Github repository using the tag and link to PyPI