diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8de4a9b..07eb92b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -236,16 +236,50 @@ The projects also uses typing checks (provided by `mypy`) and some linter checks tox ``` +Must be usually done before any pushes. + ### Generate documentation templates ```shell tox -e docs ``` +Must be usually done if there are changes in modules structure. + ### Create release ```shell -tox -m release -- x.y.z +tox -m release -- major.minor.patch ``` The command above will generate documentation, tags, etc., and will push them to GitHub. Other things will be handled by GitHub workflows automatically. + +### Hotfixes policy + +Sometimes it is required to publish hotfix with specific commits, but some features have been already committed, which should not be included to the hotfix. In this case, some manual steps are required: + +1. Create new branch from the last stable release (`major.minor.patch`): + + ```shell + git checkout -b release/major.minor major.minor.patch + ``` + +2. Cherry-pick desired commit(s): + + ```shell + git cherry-pick + ``` + + Alternatively, make changes to the new branch and commit them. + +3. Push newly created branch to remote: + + ```shell + git push --set-upstream origin release/major.minor + ``` + +4. Proceed to release as usual: + + ```shell + tox -m release -- major.minor.patch+1 + ``` diff --git a/tox.ini b/tox.ini index 224784e9..c49b8412 100644 --- a/tox.ini +++ b/tox.ini @@ -27,8 +27,6 @@ description = Run common checks like linter, mypy, etc deps = {[tox]dependencies} -e .[check] -allowlist_externals = - bash setenv = MYPYPATH=src commands = @@ -36,7 +34,7 @@ commands = pylint --rcfile=.pylintrc "src/{[tox]project_name}" bandit -c .bandit.yml -r "src/{[tox]project_name}" bandit -c .bandit-test.yml -r "tests/{[tox]project_name}" - bash -c 'mypy {[mypy]flags} -p "{[tox]project_name}" --install-types --non-interactive || mypy {[mypy]flags} -p "{[tox]project_name}"' + mypy {[mypy]flags} -p "{[tox]project_name}" --install-types --non-interactive [testenv:docs] description = Generate source files for documentation