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: .github/CONTRIBUTING.md
+14-21Lines changed: 14 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,42 +52,36 @@ First, **fork** the repository on GitHub and **clone** it using one of the alter
52
52
You can (and should) run our test suite using [*tox*](https://tox.wiki/).
53
53
However, you'll probably want a more traditional environment as well.
54
54
55
-
We recommend using the Python version from the `.python-version-default` file in the project's root directory, because that's the one that is used in the CI by default, too.
55
+
We recommend using the Python version from the `.python-version-default` file in the project's root directory.
56
56
57
-
If you're using [*direnv*](https://direnv.net), you can automate the creation of the project virtual environment with the correct Python version by adding the following `.envrc` to the project root:
57
+
We use a fully-locked development environment using [*uv*](https://docs.astral.sh/uv/) so the easiest way to get started is to [install *uv*](https://docs.astral.sh/uv/getting-started/installation/) and you can run `uv run pytest` to run the tests immediately.
58
+
59
+
I you'd like a traditional virtual environment, you can run `uv sync` and it will create a virtual environment named `.venv` with the correct Python version and install all the dependencies in the root directory.
60
+
61
+
If you're using [*direnv*](https://direnv.net), you can automate the creation and activation of the project's virtual environment with the correct Python version by adding the following `.envrc` to the project root:
or, if you like [*uv*](https://github.com/astral-sh/uv):
68
+
---
69
+
70
+
If you don't want to use *uv*, you can use Pip 25.1 (that added support for dependency groups) or newer and install the dependencies manually:
64
71
65
72
```bash
66
-
test -d .venv || uv venv --python python$(cat .python-version-default)
67
-
. .venv/bin/activate
73
+
pip install -e . --group dev
68
74
```
69
75
76
+
---
77
+
70
78
> [!WARNING]
71
79
> -**Before** you start working on a new pull request, use the "*Sync fork*" button in GitHub's web UI to ensure your fork is up to date.
72
80
>
73
81
> -**Always create a new branch off `main` for each new pull request.**
74
82
> Yes, you can work on `main` in your fork and submit pull requests.
75
83
> But this will *inevitably* lead to you not being able to synchronize your fork with upstream and having to start over.
76
84
77
-
Change into the newly created directory and after activating a virtual environment, install an editable version of this project along with its tests requirements:
You can *significantly* speed up the test suite by passing `-n auto` to *pytest* which activates [*pytest-xdist*](https://github.com/pytest-dev/pytest-xdist) and takes advantage of all your CPU cores.
90
-
91
85
---
92
86
93
87
When working on the documentation, use:
@@ -123,7 +117,6 @@ $ tox run -e docs-doctests
123
117
- If you've changed or added public APIs, please update our type stubs (files ending in `.pyi`).
124
118
125
119
126
-
127
120
## Tests
128
121
129
122
- Write your asserts as `expected == actual` to line them up nicely, and leave an empty line before them:
0 commit comments