Template for any of my upcoming Python projects
https://python-poetry.org/docs/cli/
poetry init
or
poetry new <project-name>
poetry install
poetry install --no-dev
poetry add <package-name>
Add dev dependency:
poetry add <package-name> --dev
poetry remove <package-name>
poetry update
poetry show
poetry check
poetry build
poetry publish
poetry run pytest
poetry run main.py
poetry export -f requirements.txt > requirements.txt
- install
poetryusing commandpip install poetry - run the python file
main.pyusingpoetry run main.py - or
poetry shelland then runmain.py
Single file:
poetry run pytest test/test_functions.py
Test all files in folder:
poetry run pytest test/
poetry run pre-commit install
poetry run pre-commit run --all-filesThis runs pylint, mypy, pytest tests, apply autoformatter yapf
yapf ./**/*.py -i