Extra dependencies are used for development:
poetry install
Unit tests are managed by pytest
.
You simpy run them with:
poetry run pytest
This gives code coverage automatically.
Code can be statically analyzed with mypy
:
poetry run mypy .
The source code follows the PEP8 guidelines and is linted using Black:
poetry run black .
PEP8 validity can be checked with flake8
:
poetry run flake8
The project uses pre-commit
to manage pre-commit hooks.
Install them with:
poetry run pre-commit install
The project uses changelog-cli
.
Each time a PR adds, changes, removes features or fixes a bug, the changelog should be updated with this tool:
poetry run changelog (new|change|breaks|fix) "<message>"
Version is stored in src/dependencmake/version.py:__version__
and in pyproject.toml
, it respects semantic versionning.
It is bumped with bump2version
:
poetry run bumpversion (major|minor|patch)
- Checkout to the
develop
branch and pull:Check if there are any cosmetic changes to make;git checkout develop git pull
- Update changelog:
It should suggest a major/minor/patch release depending on the content of the changelog. You can also manually specify the desired version with
poetry run changelog release git add CHANGELOG.md git commit -n -m "Update CHANGELOG for release"
--patch
,--minor
,--major
; - Update license to have correct year for release:
bash ./update_license.sh git add LICENSE git commit -n -m "Update LICENSE for release"
- Bump version to obtain the same version as in changelog:
It commits and creates the Git tag automatically;
poetry run bumpversion (major|minor|patch)
- Push the changes to the server, with the tag:
git push git push origin <tag>
- Checkout to the
master
branch, pull, merge the tagged commit previously created, then push:git checkout master git pull git merge <tag> git push
- Create the distribution files and publish them:
poetry publish --build
- On Github, draft a new release, set the version number with the created tag ("Existing tag" should be read). Set the release title with "Version " and copy-paste the corresponding section of the changelog file in the release description.