This folder is a base template for python projects developped by Bicocca.
A clean code is easy to read, to understand, and to maintain... Prioritizes clarity over cleverness.
- Use the single responsibility principle.
- Use self documenting naming.
- Avoid code duplication.
The project use:
- Black for code format
- Pylint for code analysis (note that the actual pylintrc will be use in every child repository throug github actions).
The main branch is protected and can be changed only by merging a branch after a pull-request.
A pull request will trigger the prepare_pr workflow:
- ensure the code formatting
- analyse the code with pylint
Pushing changing in the repository will trigger the CICD and run the test.
A merge of a pull request will use semantic release to increment and eventually create a new version on the github repository.
Semantic release use commit comments that follow the following following convention:
- fix(Title): detail of the fix --> increase the minor version digit.
- feat(Title): detail of the feature --> increase the mid version digit.
The two previous message can be followed (Leave a blank line) by: BREAKING CHANGE: description of the breaking change. In order to increase the major version digit.
see https://github.com/semantic-release/semantic-release for more information.
The 'requirements.txt' can be use to install project dependencies either:
- using conda: "conda install --file requirements.txt"
- using pip: "pip install -r requirements.txt"
It is strongly recommended to use a virtual environement that can be created with the "venv" module (python -m venv venv_name) and activated with the "activate" script in the folder "venv_name/Scripts".
You can also directly use pycharm (or another IDE) to create a virtual environement from the file "requirements.txt".
DO NOT EDIT the "requirements.txt" it should be automatically created from the file "requirements.in".
- create and activate a venv
- activate the venv
- install the pip-tools module
- run the pip-compile command in the same folder as the file "requirements.in".
see https://pypi.org/project/pip-tools/2.0.1/ for more information.