Skip to content

Commit c8c52ca

Browse files
Fix stale developer documentation
- 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
1 parent f7589d9 commit c8c52ca

2 files changed

Lines changed: 21 additions & 28 deletions

File tree

docs/contributing.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ This creates the directory `tstrait` and connects your repository to the upstrea
2525
tstrait repository.
2626

2727
- 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.
2929

3030
### Develop your contribution
3131

3232
- 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.
3535

3636
### Submit your contribution
3737

@@ -51,21 +51,11 @@ Afterwards, go to Github and open a pull request by pressing a green Pull Reques
5151

5252
## Requirements
5353

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:
5656

5757
```
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
6959
```
7060

7161
## Documentation
@@ -80,7 +70,7 @@ All files that are used in the documentation are included in the `docs` director
8070
the documentation, run the following code in the `doc` directory:
8171

8272
```
83-
jupyter-book build .
73+
make
8474
```
8575

8676
### API Reference
@@ -102,7 +92,7 @@ the code examples will always be up to date.
10292
## Continuous integration tests
10393

10494
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.
10696

10797
All tests are located in the `tests` directory, and run using [pytest](https://docs.pytest.org/en/stable/).
10898
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
114104
the desired statistical properties. Since these tests are quite expensive to run and difficult to automatically
115105
validate, they are not run as part of continuous integration (CI) but instead as a pre-release sanity check.
116106

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:
121114

122115
```
123-
$ python3 verification.py
116+
$ uv run --group verification verification.py
124117
```
125118

126119
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
129122
algorithms.
130123

131124
Please read the comments at the top of the `verification.py` script for details on how to write and run
132-
these tests.
125+
these tests.

docs/install.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We recommend using `conda` for most users.
77

88
## System requirements
99

10-
tstrait requires Python 3.10+. Python dependencies are installed automatically by `pip` or `conda`.
10+
tstrait requires Python 3.11+. Python dependencies are installed automatically by `pip` or `conda`.
1111

1212
## Via conda
1313

@@ -46,7 +46,7 @@ tstrait requires the following dependencies:
4646

4747
| Package | Minimum supported version |
4848
| ------------------------------------ | ------------------------- |
49-
| [NumPy](https://numpy.org) | 1.20.3 |
50-
| [numba](https://numba.pydata.org/) | 0.57.0 |
49+
| [NumPy](https://numpy.org) | 2 |
50+
| [numba](https://numba.pydata.org/) | |
5151
| [pandas](https://pandas.pydata.org/) | 1.0 |
52-
| [tskit](https://tskit.dev/) | 0.5.5 |
52+
| [tskit](https://tskit.dev/) | 1 |

0 commit comments

Comments
 (0)