You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/contributing.md
+40-6Lines changed: 40 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,7 @@ Use the standard github workflow.
12
12
13
13
2. Setup the virtual environment for this project.
14
14
15
-
3. Install all the development requirements.
16
-
17
-
```shell
18
-
pip install -r dev_requirements.txt
19
-
```
15
+
3. Install all the development requirements (refer to the options described below).
20
16
21
17
4. Install git pre-commit hooks.
22
18
@@ -28,7 +24,45 @@ pre-commit install
28
24
29
25
6.[Create a pull request from your fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
30
26
31
-
## Code formatting.
27
+
## Installing the development requirements
28
+
29
+
### Using uv
30
+
31
+
Easy package management can be accomplished using the [uv](https://docs.astral.sh/uv/) tool which will need to be available on
32
+
your local workstation. As explained in [the official uv documentation](https://docs.astral.sh/uv/getting-started/installation/),
33
+
a number of straightforward installation options are available. uv is supported by IDEs such as [PyCharm](https://www.jetbrains.com/help/pycharm/uv.html).
34
+
35
+
36
+
After the first clone of this repository, run the following command in the root directory.
37
+
This will automatically create
38
+
a new virtual environment in the folder `.venv` and install all required NIR project dependencies to it.
39
+
40
+
```shell
41
+
uv sync
42
+
```
43
+
44
+
45
+
To run commands within the uv virtual environment, prefix them with `uv run`.
46
+
For example, to run all the tests:
47
+
48
+
```shell
49
+
uv run pytest
50
+
```
51
+
52
+
Alternatively, you can activate the virtual environment in your current terminal and run commands directly.
53
+
For example:
54
+
```shell
55
+
source .venv/bin/activate
56
+
pytest
57
+
```
58
+
59
+
### Using pip
60
+
61
+
```shell
62
+
pip install -r dev_requirements.txt
63
+
```
64
+
65
+
## Code formatting
32
66
33
67
We use `black` to format the code and `ruff` to linting.
34
68
The rules and formatting are embedded in the `pre-commit hooks`. So you do not need to explicitly worry about these but is good to know when you see erros while commiting your code or in the CI.
0 commit comments