We use poetry
to manage the dependencies.
If you don't have poetry
, you should install with make poetry-download
.
To install dependencies and prepare pre-commit
hooks you would need to run install
command:
make install
make pre-commit-install
poetry run pre-commit install
pre-commit run --all-files
export PATH="$HOME/.poetry/bin:$PATH"
make install
make pre-commit-install
pre-commit run --all-files
make test && make coverage && make check-codestyle && make mypy && make check-safety && make extrabadges
pre-commit run --all-files
- Install Poetry:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
- Find the poetry installation directory:
C:\Users\YourUsername\AppData\Roaming\Python\Scripts
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\Scripts (where XX is the Python version)
- Add the correct Path to
PATH
:
$env:PATH = "C:\Users\YourUsername\AppData\Roaming\Python\Scripts;" + $env:PATH
- Verify poetry installation:
poetry --version
- Create and activate a new virtual environment:
python -m venv .venv
.\.venv\Scripts\activate
- Install required libraries:
poetry lock -n; poetry export --without-hashes > requirements.txt
poetry install -n
- Type check with mypy
poetry run mypy --install-types --non-interactive pycvcqv/ tests/
- Unit tests and coverage
poetry run pytest --cov-report html --cov pycvcqv tests/
poetry run coverage-badge -o assets/images/coverage.svg -f
- Lint
poetry run pylint pycvcqv tests
- Code-style check
poetry run pyupgrade --exit-zero-even-if-changed --py37-plus
poetry run isort --diff --check-only --settings-path pyproject.toml ./
poetry run black --diff --check --config pyproject.toml ./
poetry run darglint --verbosity 2 pycvcqv tests
poetry run interrogate -v pycvcqv
- Safety check
poetry check
poetry run safety check --policy-file safety_policy.yml
poetry run bandit -ll --configfile pyproject.toml --recursive pycvcqv tests
- Code maintainability and complexity
.\.shell\maintainability.ps1
.\.shell\complexity.ps1
- Creating badges data
.\.shell\badges.ps1
git pull
pre-commit run --all-files
git add .
git commit -m ":tada: Initial commit"
git push -u origin main
poetry run jupyter-book build .\assets\docs\pycvcqv
- Upload to pypi (for maintainers)
pip install twine
pip install --upgrade build
python -m build
python -m twine upload --repository pycvcqv dist/*
git tag -a <tag_name> -m "<message>"
git push -u origin <tag_name>
You can contribute by spreading a word about this library. It would also be a huge contribution to write a short article on how you are using this project. You can also share your best practices with us.