Debian Codegraph @

CONTRIBUTING.md

raw
1 # Contributing
2
3 ## The basics
4
5 Your help is appreciated and welcome!
6
7 The _master_ branch is meant to hold the release code. At any time this should be
8 identical to the code available on PyPI.
9
10 PRs will be pushed on the _development_ branch if the actual package code is changed. When the time comes this branch
11 will be merged to the _master_ branch and a new release will be issued.
12
13 PRs that deal with documentation, and other adjacent files (README for example) can be pushed to the _master_ branch.
14
15 When submitting PRs please take into account:
16
17 - the project's goals
18 - PEP8 and the style guide below
19
20 ## Developer instructions
21
22 Clone the repository with submodules, make sure you have a C compiler installed, then install the development dependencies (we recommend using a virtual environment):
23
24 ```bash
25 python -m venv .venv # create virtual environment in .venv
26 source .venv/bin/activate # activate virtual environment (POSIX)
27 .venv\Scripts\activate.bat # activate virtual environment (Windows)
28 pip install --requirement requirements.txt # install development dependencies (includes asammdf in editable mode)
29 ```
30
31 Now you can start developing. If you are using VSCode, the virtual environment should be detected automatically. If not, open the command panel `Ctrl + Shift + P` and search for `Python: Select Interpreter`.
32
33 ## Testing
34
35 You can use tox to run tests locally. Example for the unit tests with Python version 3.10:
36
37 ```console
38 tox -e py310
39 ```
40
41 Otherwise, you can just push and the tests will be run by GitHub Actions.
42
43 ## Style guide
44
45 Just run [`ruff format`](https://docs.astral.sh/ruff/formatter/) on modified files before sending the PR. There is no need to reinvent the wheel here!
46
47 **Tip**: install Git hooks using pre-commit `pre-commit install --install-hooks`