Skip to content

Commit edabe9b

Browse files
committed
Update contributing guide
1 parent 7072041 commit edabe9b

1 file changed

Lines changed: 35 additions & 46 deletions

File tree

CONTRIBUTING.md

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,56 @@
22

33
## Environment
44

5-
Development is currently done using Python 3.12. We recommend using a virtual
6-
environment such as ``venv``:
5+
Development is currently done using Python 3.13. The environment can be created with:
76

8-
python3.12 -m venv venv
9-
source venv/bin/activate
7+
```shell
8+
uv sync
9+
```
1010

11-
In your virtual environment, please install all packages for
12-
development by running:
13-
14-
pip install -r requirements.txt
15-
16-
## Pre-Commit
17-
18-
Also be sure to install `pre-commit`, which is run every time
19-
you make a git commit:
20-
21-
pre-commit install
22-
23-
With pre-commit, all code is formatted according to
24-
[ruff](https://docs.astral.sh/ruff/) guidelines.
25-
26-
To check if your changes pass pre-commit without committing, run:
27-
28-
pre-commit run --all-files
29-
30-
## Testing
31-
32-
To run the tests and view coverage, execute:
33-
34-
pytest --cov hdx
35-
36-
Follow the example set out already in ``documentation/main.md`` as you write the documentation.
11+
This creates a .venv folder with the versions specified in the project's uv.lock file.
3712

3813
## Packages
3914

40-
[uv](https://github.com/astral-sh/uv) is used for
41-
package management. If you’ve introduced a new package to the
42-
source code (i.e.anywhere in `src/`), please add it to the
43-
`project.dependencies` section of
44-
`pyproject.toml` with any known version constraints.
15+
[uv](https://github.com/astral-sh/uv) is used for package management. If
16+
you’ve introduced a new package to the source code (i.e. anywhere in `src/`),
17+
please add it to the `project.dependencies` section of `pyproject.toml` with
18+
any known version constraints.
4519

46-
To add packages for testing or development, add them to the `test` or `dev`
47-
sections under `[project.optional-dependencies]`.
20+
To add packages required only for testing, add them to the
21+
`[dependency-groups]`.
4822

4923
Any changes to the dependencies will be automatically reflected in
50-
`requirements.txt` with `pre-commit`, but you can re-generate
51-
the file without committing by executing:
24+
`uv.lock` with `pre-commit`, but you can re-generate the files without committing by
25+
executing:
5226

53-
pre-commit run pip-compile --all-files
27+
```shell
28+
uv lock --upgrade
29+
```
5430

5531
## Project
5632

57-
[Hatch](https://hatch.pypa.io/) is used for project management. The project
58-
can be built using:
33+
[uv](https://github.com/astral-sh/uv) is used for project management. The project can be
34+
built using:
5935

60-
hatch build
36+
```shell
37+
uv build
38+
```
6139

6240
Linting and syntax checking can be run with:
6341

64-
hatch fmt --check
42+
```shell
43+
uv run ruff check
44+
```
45+
46+
To run the tests and view coverage, execute:
47+
48+
```shell
49+
uv run pytest
50+
```
51+
52+
## Documentation
6553

66-
Tests can be executed using:
54+
The documentation, including API documentation, is generated using ReadtheDocs and
55+
MkDocs with Material. As you change the source code, remember to update the
56+
documentation at `documentation/index.md`.
6757

68-
hatch test

0 commit comments

Comments
 (0)