Skip to content

Commit e029f56

Browse files
committed
Move contributing to README.md
1 parent fcd19d2 commit e029f56

2 files changed

Lines changed: 84 additions & 74 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 74 deletions
This file was deleted.

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,87 @@ For more information, please read the
1414
This library is part of the [Humanitarian Data Exchange](https://data.humdata.org/)
1515
(HDX) project. If you have humanitarian related data, please upload your datasets to
1616
HDX.
17+
18+
# Development
19+
20+
## Environment
21+
22+
Development is currently done using Python 3.13. The environment can be created with:
23+
24+
```shell
25+
uv sync
26+
```
27+
28+
This creates a .venv folder with the versions specified in the project's uv.lock file.
29+
30+
### Pre-commit
31+
32+
pre-commit will be installed when syncing uv. It is run every time you make a git
33+
commit if you call it like this:
34+
35+
```shell
36+
pre-commit install
37+
```
38+
39+
With pre-commit, all code is formatted according to
40+
[ruff](https://docs.astral.sh/ruff/) guidelines.
41+
42+
To check if your changes pass pre-commit without committing, run:
43+
44+
```shell
45+
pre-commit run --all-files
46+
```
47+
48+
## Packages
49+
50+
[uv](https://github.com/astral-sh/uv) is used for package management. If
51+
you’ve introduced a new package to the source code (i.e. anywhere in `src/`),
52+
please add it to the `project.dependencies` section of `pyproject.toml` with
53+
any known version constraints.
54+
55+
To add packages required only for testing, add them to the
56+
`[dependency-groups]`.
57+
58+
Any changes to the dependencies will be automatically reflected in
59+
`uv.lock` with `pre-commit`, but you can re-generate the files without committing by
60+
executing:
61+
62+
```shell
63+
uv lock --upgrade
64+
```
65+
66+
## Project
67+
68+
[uv](https://github.com/astral-sh/uv) is used for project management. The project can be
69+
built using:
70+
71+
```shell
72+
uv build
73+
```
74+
75+
Linting and syntax checking can be run with:
76+
77+
```shell
78+
uv run ruff check
79+
```
80+
81+
To run the tests and view coverage, execute:
82+
83+
```shell
84+
uv run pytest
85+
```
86+
87+
For the `test_ckan.py` test to run successfully, some configuration is required:
88+
89+
1. The environment variable HDX_KEY_TEST needs to contain a valid key from the HDX demo
90+
server at https://demo.data-humdata-org.ahconu.org/
91+
1. Authentication details for Google Sheets need to be obtained and either saved in a
92+
file named `.gsheet_auth.json` in the home directory (~) or placed in an environment
93+
variable `GSHEET_AUTH`. The file is preferred for Windows systems since adding such a
94+
long text string to an environment variable in Windows is challenging.
95+
96+
## Documentation
97+
98+
The documentation, including API documentation, is generated using ReadtheDocs and
99+
MkDocs with Material. As you change the source code, remember to update the
100+
documentation at `documentation/index.md`.

0 commit comments

Comments
 (0)