For development, you need the extra dependencies:
pip install -r requirements_dev.txtTests are run by Pytest with:
pytestBoth Pytest style and standard Unittest style tests can be used. Coverage is checked automatically with Pytest-cov.
Imports are sorted by isort with the command:
isort .You need to call isort before committing changes.
The code follows the PEP8 style guide (88 characters per line). Quality of code is checked with Ruff:
ruff check .Style is enforced using Black:
black .You need to call Black before committing changes. You may want to configure your editor to call it automatically. Additionnal checking can be manually performed with Pylint.
Pre-commit hooks allow to perform checks before commiting changes. They are managed with Pre-commit, use the following command to install them:
pre-commit installThe project uses drf-spectacular for the self-documentation of the API.
You can generate and browse it locally with:
./manage.py spectacular --color --file schema.yml
docker run -p 80:8080 -e SWAGGER_JSON=/schema.yml -v ${PWD}/schema.yml:/schema.yml swaggerapi/swagger-ui- Move to the
developbranch and pull.If there are cosmetic modifications to perform on the changelog file, do it now.git checkout develop git pull
- Call the bump version script:
with
./bump_version.sh 0.0.0 0.1.0
0.0.0the release version number and0.1.0the next version (without 'v', without '-dev'). - Push the version commit and its tag:
git push git push --tags
- Move to the
masterbranch and merge created tag into it. Then push.git checkout master git pull git merge 0.0.0 git push
- Before creating the server bundle, make sure dependencies are up to date:
pip install -r requirements.txt -r requirements_dev.txt
- Call the script to create the archive:
with
./create_archive.sh 0.0.0 9.9.9
0.0.0the according version number and9.9.9the corresponding Dakara web client version number. - On GitHub, draft a new release, set the version number with the created tag ("Existing tag" should read). Set the release title with "Version 0.0.0" (with number, you get it?). Copy-paste corresponding section of the changelog file in the release description. Add the created archive file. You can now publish the release.