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
- Update Python requirement to 3.11+
- Update dependency minimum versions to match pyproject.toml
- Replace pre-commit references with prek throughout
- Update dev setup to use uv sync --group dev (no optional extras exist)
Update
Copy file name to clipboardExpand all lines: docs/contributing.md
+17-24Lines changed: 17 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,13 @@ This creates the directory `tstrait` and connects your repository to the upstrea
25
25
tstrait repository.
26
26
27
27
- Install the [requirements](requirements).
28
-
- Run the tests to ensure everything has worked: `python3 -m pytest`. These should all pass.
28
+
- Run the tests to ensure everything has worked: `uv run pytest`. These should all pass.
29
29
30
30
### Develop your contribution
31
31
32
32
- Make your changes in a local branch. On each commit, a
33
-
[pre-commit hook](https://pre-commit.com/) will check for code styles and common problems.
34
-
You can also use `pre-commit run` to run the checks without committing.
33
+
[prek](https://prek.j178.dev) hook will check for code styles and common problems.
34
+
You can also use `uv run prek --all-files` to run the checks without committing.
35
35
36
36
### Submit your contribution
37
37
@@ -51,21 +51,11 @@ Afterwards, go to Github and open a pull request by pressing a green Pull Reques
51
51
52
52
## Requirements
53
53
54
-
The packages needed for development are specified as optional dependencies
55
-
in the ``pyproject.toml`` file. Install these using:
54
+
The packages needed for development are specified as dependency groups
55
+
in ``pyproject.toml``. Install them using:
56
56
57
57
```
58
-
python3 -m venv env
59
-
source env/bin/activate
60
-
python3 -m pip install -e ".[dev]"
61
-
```
62
-
63
-
Alternatively, you can use uv for faster dependency management:
64
-
65
-
```
66
-
uv venv
67
-
source .venv/bin/activate
68
-
uv pip install -e ".[dev]"
58
+
uv sync
69
59
```
70
60
71
61
## Documentation
@@ -80,7 +70,7 @@ All files that are used in the documentation are included in the `docs` director
80
70
the documentation, run the following code in the `doc` directory:
81
71
82
72
```
83
-
jupyter-book build .
73
+
make
84
74
```
85
75
86
76
### API Reference
@@ -102,7 +92,7 @@ the code examples will always be up to date.
102
92
## Continuous integration tests
103
93
104
94
Continuous integration tests are implemented in [Github actions](https://docs.github.com/en/actions), and it runs a variety of code style and quality checks using
105
-
[pre-commit](https://pre-commit.com/) along with Python tests on Linux.
95
+
[prek](https://prek.j178.dev) along with Python tests on Linux.
106
96
107
97
All tests are located in the `tests` directory, and run using [pytest](https://docs.pytest.org/en/stable/).
108
98
All new code must have high test coverage, which will be checked as part of the continuous integration
@@ -114,13 +104,16 @@ We run many statistical tests to ensure that tstrait is simulating the correct p
114
104
the desired statistical properties. Since these tests are quite expensive to run and difficult to automatically
115
105
validate, they are not run as part of continuous integration (CI) but instead as a pre-release sanity check.
116
106
117
-
The statistical tests are all run via the `verification.py` script in the project root. The script has some
118
-
extra dependencies specified in the `verification` optional dependencies in `pyproject.toml`, which can be installed using
119
-
`pip install -e ".[verification]"` or `uv pip install -e ".[verification]"`. You should also need to install [R](https://www.r-project.org/)
120
-
into your environment. Run this script using:
107
+
The statistical tests are all run via the `verification.py` script in the project root.
108
+
You need to install [R](https://www.r-project.org/) into your environment
109
+
for these checks. The script has some
110
+
extra dependencies specified in the `verification` dependency group in `pyproject.toml`,
111
+
which are installed automatically.
112
+
`uv sync --group verification`.
113
+
Run this script using:
121
114
122
115
```
123
-
$ python3 verification.py
116
+
$ uv run --group verification verification.py
124
117
```
125
118
126
119
The statistical tests use scripts in `scripts` directory to compare the tstrait simulation output
@@ -129,4 +122,4 @@ against [AlphaSimR](https://cran.r-project.org/web/packages/AlphaSimR/index.html
129
122
algorithms.
130
123
131
124
Please read the comments at the top of the `verification.py` script for details on how to write and run
0 commit comments