The project structure is based on Kenneth Reitz recommendation.
https://docs.python-guide.org/writing/structure/#structure-of-the-repository
Create conda env as explain in README.md
conda install -n karios -c conda-forge --file requirements_dev.txt
It installs:
bandit
: Bandit is a tool for finding common security issues in Python codeisort
: sort importblack
: format codepylint
: code linterpytest-cov
: pytest with code coverage supportpycodestyle
: check docstringpre-commit
: pre commit hook engine : https://pre-commit.com/
pre-commit creates and install git pre commit hook configured thanks to .pre-commit-config.yaml
You MUST deploy pre-commit !
pre-commit install && pre-commit install --hook-type pre-push
Try it
pre-commit run
Please, format the code before commit by using the following command :
isort --profile black . && black -l 100 .
As an alternative, you can configure your IDE to let it do it for you.
Use linter to check code quality:
PYTHONPATH=karios pylint karios/
Test Data
- Retrieve test data here,
- Create a folder
/data/KARIOS/
- Extract test data archive in the folder
/data/KARIOS/
Run tests before push:
PYTHONPATH=karios \
pytest -s --cov=karios --cov-report html:cov_html tests; \
python -c 'import webbrowser; webbrowser.open_new_tab("./cov_html/index.html")'
For reports options take a look at this : https://pytest-cov.readthedocs.io/en/latest/reporting.html