Skip to content

Latest commit

 

History

History
117 lines (90 loc) · 2.87 KB

CONTRIBUTING.md

File metadata and controls

117 lines (90 loc) · 2.87 KB

Contributing

Install development dependencies

Extra dependencies are used for development:

poetry install

Tests

Unit tests

Unit tests are managed by pytest. You simpy run them with:

poetry run pytest

This gives code coverage automatically.

Static tests

Code can be statically analyzed with mypy:

poetry run mypy .

Code style

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

Hooks

The project uses pre-commit to manage pre-commit hooks. Install them with:

poetry run pre-commit install

Changelog

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

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)

Release process

  1. Checkout to the develop branch and pull:
    git checkout develop
    git pull
    Check if there are any cosmetic changes to make;
  2. Update changelog:
    poetry run changelog release
    git add CHANGELOG.md
    git commit -n -m "Update CHANGELOG for release"
    It should suggest a major/minor/patch release depending on the content of the changelog. You can also manually specify the desired version with --patch, --minor, --major;
  3. Update license to have correct year for release:
    bash ./update_license.sh
    git add LICENSE
    git commit -n -m "Update LICENSE for release"
  4. Bump version to obtain the same version as in changelog:
    poetry run bumpversion (major|minor|patch)
    It commits and creates the Git tag automatically;
  5. Push the changes to the server, with the tag:
    git push
    git push origin <tag>
  6. Checkout to the master branch, pull, merge the tagged commit previously created, then push:
    git checkout master
    git pull
    git merge <tag>
    git push
  7. Create the distribution files and publish them:
    poetry publish --build
  8. 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.