- If you installed asdf, you can simply run:
for plugin in $(cut -d " " -f 1 < .tool-versions); do
asdf plugin add "${plugin}"
done
asdf install
- This will:
- install asdf plugins for this repository
- install the version of tool required for this repository
- run
make setup-venv
so thatpoetry
inits a virtual environment with required dependencies (same aspoetry install --sync
) - run
eval $(make echo-venv-activate-cmd)
to activate the virtual environment if needed
Run make update-requirements-file
, this will basically:
- run
poetry lock
to update the dependencies and the lock file - update the
requirements.txt
file used by tox virutal environments (to save a call to poetry each time you run tox)
- run
make tests
to launch unit tests (same astox -e py3
) - run
make lint
to launch linters (same astox -e linters
):black
(see the pyproject.toml for the black configuration)isort
(see the pyproject.toml for the isort configuration + the tox.ini because we configure isort with--dont-order-by-type
that cannot be specified in a config file)flake8
pylint
- If you want to run pre-commit before each commit, run once
make precommit-install
- If you don't want to configure a pre-commit hook (your choice, pre-commit is run by the CICD anyway), you can run it when you want, use
make precommit-run
- It's a good idea to install the EditorConfig for VSCode extension
- Your
settings.json
(user or workspace or project) should contain:
{
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
},
"python.formatting.provider": "black",
"isort.args": [
"--dont-order-by-type"
],
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true
}
- Feel free to contribute any other editor configuration