| 1 |
# CONTRIBUTING |
| 2 |
|
| 3 |
Please follow github workflow. Create a ticket and/or branch. Create a pull-request. |
| 4 |
|
| 5 |
## Local Development |
| 6 |
|
| 7 |
### Installation |
| 8 |
|
| 9 |
Please install these tools: |
| 10 |
|
| 11 |
* [`uv` Installation](https://docs.astral.sh/uv/getting-started/installation/) |
| 12 |
* [`make`](https://www.gnu.org/software/make/) |
| 13 |
* [`git`](https://git-scm.com/) |
| 14 |
* [Visual Studio Code](https://code.visualstudio.com/) |
| 15 |
* [`graphviz`](https://graphviz.org/) |
| 16 |
|
| 17 |
|
| 18 |
### Editor |
| 19 |
Start Visual Studio Code: |
| 20 |
|
| 21 |
```bash |
| 22 |
make code |
| 23 |
``` |
| 24 |
|
| 25 |
### Testing |
| 26 |
|
| 27 |
Run auto-formatting, linting, tests and documentation build: |
| 28 |
|
| 29 |
```bash |
| 30 |
make all |
| 31 |
``` |
| 32 |
|
| 33 |
See `make help` for any further details. |
| 34 |
|
| 35 |
Please note that `tests/refdata` contains reference data from test runs. |
| 36 |
`make test2refdata` updates this directory. |
| 37 |
|
| 38 |
## Project Structure |
| 39 |
|
| 40 |
The project contains these files and directories: |
| 41 |
|
| 42 |
| File/Directory | Description | |
| 43 |
|---|---| |
| 44 |
| `src/` | Python Package Sources - the files this is all about | |
| 45 |
| `pyproject.toml` | Python Package Meta File. Also contains all tool settings | |
| 46 |
| `.gitignore` | Lists of files and directories ignored by version control system | |
| 47 |
| `.github/` | Github Settings | |
| 48 |
| `.readthedocs.yaml` | Documentation Server Configuration | |
| 49 |
| `.pre-commit-config.yaml` | Pre-Commit Check Configuration | |
| 50 |
| `uv.lock` | File with resolved python package dependencies | |
| 51 |
|
| 52 |
Next to that, there are some temporary files ignored by version control system. |
| 53 |
|
| 54 |
| File/Directory | Description | |
| 55 |
|---|---| |
| 56 |
| `htmlcov/` | Test Execution Code Coverage Report in HTML format | |
| 57 |
| `report.xml` | Test Execution Report | |
| 58 |
| `.venv` | Virtual Environments | |
| 59 |
|
| 60 |
|
| 61 |
## Branches |
| 62 |
|
| 63 |
* `2.x.x` main line for `2.x.x` |
| 64 |
* `3.x.x` main line for `3.x.x` |
| 65 |
* documentation links refer to `3.x.x` |
| 66 |
* 2.x.x can be merged to 3.x.x |
| 67 |
* `main` |
| 68 |
* 2.x.x can be merged to main |
| 69 |
|
| 70 |
|
| 71 |
### Release |
| 72 |
|
| 73 |
```bash |
| 74 |
# Update 3.x.x |
| 75 |
git checkout 3.x.x |
| 76 |
git pull origin 2.x.x |
| 77 |
git push origin 3.x.x |
| 78 |
|
| 79 |
prev_version=$(poetry version -s) |
| 80 |
|
| 81 |
# Version Bump |
| 82 |
poetry version minor |
| 83 |
# OR |
| 84 |
poetry version patch |
| 85 |
|
| 86 |
# Commit, Tag and Push |
| 87 |
version=$(poetry version -s) |
| 88 |
|
| 89 |
sed "s/$prev_version/$version/g" -i anytree/__init__.py |
| 90 |
|
| 91 |
git commit -m"version bump to ${version}" pyproject.toml anytree/__init__.py |
| 92 |
git tag "${version}" -m "Release ${version}" |
| 93 |
git push |
| 94 |
git push --tags |
| 95 |
|
| 96 |
# Update main |
| 97 |
git checkout main |
| 98 |
git pull origin 2.x.x |
| 99 |
git push origin main |
| 100 |
|
| 101 |
# Publishing is handled by CI |
| 102 |
``` |