Template PyProject
pip install template-pyproject
>>> from template_pyproject import fib
>>> fib(0)
0
For more details, read the documentation.
If you want to test or change the source code, prepare your local environment.
-
Clone the repository.
git clone git@github.com:91nunocosta/template-pyproject.git
-
Open the project directory.
cd template-pyproject
-
Install poetry package and dependency manager. Follow the poetry installation guide. Chose the method that is more convenient to you, for example:
curl -sSL\ https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \ | python -
-
Create a new virtual environment (managed by poetry) with the project dependencies.
poetry install --with dev
-
Enter the virtual environment.
poetry shell
-
Install pre-commit verifications.
pre-commit install -t pre-commit -t pre-push -t commit-msg
Pre-commit runs the linters and tests configured in .pre-commit-config.yaml. You can check the pre-commit phase locally:
-
Prepare the development environment, as described in Preparing the development environment.
-
Run pre-commit with all files.
pre-commit run --all-files
Tests are executed by tox.ini. You can check the tox phase locally:
-
Prepare the development environment, as described in Preparing the development environment.
-
Run tox.
tox