|
2 | 2 |
|
3 | 3 | ## Environment |
4 | 4 |
|
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: |
7 | 6 |
|
8 | | - python3.12 -m venv venv |
9 | | - source venv/bin/activate |
| 7 | +```shell |
| 8 | + uv sync |
| 9 | +``` |
10 | 10 |
|
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. |
37 | 12 |
|
38 | 13 | ## Packages |
39 | 14 |
|
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. |
45 | 19 |
|
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]`. |
48 | 22 |
|
49 | 23 | 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: |
52 | 26 |
|
53 | | - pre-commit run pip-compile --all-files |
| 27 | +```shell |
| 28 | + uv lock --upgrade |
| 29 | +``` |
54 | 30 |
|
55 | 31 | ## Project |
56 | 32 |
|
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: |
59 | 35 |
|
60 | | - hatch build |
| 36 | +```shell |
| 37 | + uv build |
| 38 | +``` |
61 | 39 |
|
62 | 40 | Linting and syntax checking can be run with: |
63 | 41 |
|
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 |
65 | 53 |
|
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`. |
67 | 57 |
|
68 | | - hatch test |
0 commit comments