Skip to content

Commit dbc6fe3

Browse files
authored
replace requirements files with uv.lock (#1353)
* update docs * explicit pin of build-system
1 parent c8b5ec0 commit dbc6fe3

20 files changed

+3116
-1894
lines changed

.github/workflows/black.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ jobs:
2626
uses: actions/checkout@v4
2727
with:
2828
submodules: true
29+
- name: Install the latest version of uv
30+
uses: astral-sh/setup-uv@v5
31+
with:
32+
version: "latest"
33+
python-version: ${{ matrix.python }}
2934
- name: Install black
3035
run: |
31-
python -m pip install black=="24.10.0"
36+
uv sync --only-group format
3237
- name: Validate code
3338
run: |
34-
find . -name '*.py'|grep -v headers|grep -v demes-spec|xargs python -m black --check
39+
find fwdpy11 tests tests_with_cpp examples -name '*.py' | grep -v headers | grep -v demes-spec | xargs python -m black --check
3540
3641

.github/workflows/docs.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ jobs:
5656
run: |
5757
sudo apt install --fix-missing -y libgsl-dev cmake
5858
59-
- name: Install Python dependencies
60-
run: |
61-
uv pip install -r requirements/CI_${{ matrix.python-version }}.txt
62-
6359
- name: rustc version
6460
run: |
6561
rustc --version
@@ -68,9 +64,9 @@ jobs:
6864
run: |
6965
cbindgen --version
7066
71-
- name: Build module
67+
- name: uv sync
7268
run: |
73-
uv pip install -e .
69+
uv sync -p ${{ matrix.python-version }} --locked --group build --group doc --no-dev
7470
7571
- name: Build the docs
7672
working-directory: doc

.github/workflows/macos_CI.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ jobs:
5252

5353
- name: Install Python dependencies
5454
run: |
55-
uv pip install -r requirements/CI_${{ matrix.python }}.txt
55+
# We need to build the C++ test suite, etc., so
56+
# we don't let uv install the project (b/c the other
57+
# stuff isn't built in that case)
58+
uv sync -p ${{ matrix.python }} --no-install-project --frozen --group build
59+
5660
- name: Build extension module
5761
run: |
5862
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_UNIT_TESTS=ON -DDISABLE_LTO=ON

.github/workflows/ubuntu.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ jobs:
8989
run: |
9090
python --version
9191
92-
- name: Install pip dependencies
92+
- name: Install python dependencies
9393
run: |
94-
uv pip install -r requirements/CI_${{ matrix.python }}.txt
94+
# We need to build the C++ test suite, etc., so
95+
# we don't let uv install the project (b/c the other
96+
# stuff isn't built in that case)
97+
uv sync -p ${{ matrix.python }} --no-install-project --frozen --group build
9598
9699
# Need# ed so that we don't affect building any pip dependencies with these flags
97100
- name: Set CPPFLAGS for C++ builds

doc/misc/developersguide.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,14 @@ The C++ test suite requires:
3636
:::{warning}
3737
`conda` users **must** install all of these dependencies using that system, including the compilers!
3838
See [here](https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html) for info about `conda` compilers for Linux and for macOS.
39-
40-
The `requirements/` folder of the source code repository contains a list of minimal `conda` dependencies that we use for CI.
4139
:::
4240

4341
#### Python
4442

4543
To reproduce the environments that we use for CI and deployment:
4644

4745
```sh
48-
python3 -m pip install -r requirements/development.txt
46+
uv sync --no-install-package --all-groups
4947
```
5048

5149
```{note}

pyproject.toml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[build-system]
22
# We need setup.cfg support, which setuptools indtroduced in 30.3.0.
33
requires = [
4-
"scikit-build-core>=0.3.3",
5-
"setuptools_scm>=8",
4+
"scikit-build-core==0.11.1",
5+
"setuptools_scm==7.1.0",
66
"pybind11[global]==2.12.0",
77
"numpy >= 2.0"
88
]
@@ -31,6 +31,49 @@ dependencies = [
3131
]
3232
requires-python = ">=3.10, <3.14"
3333

34+
[dependency-groups]
35+
# NOTE: we are doing a very odd hack here!
36+
# uv does NOT currently support locking build dependencies
37+
# so we add it as a dependency group and force it.
38+
# The PROBLEM is that we have TWO places to modify
39+
# things in the future.
40+
build = [
41+
"scikit-build-core==0.11.1",
42+
"setuptools_scm==7.1.0",
43+
"pybind11[global]==2.12.0",
44+
"numpy >= 2.0"
45+
]
46+
format = [
47+
"black==24.10.0"
48+
]
49+
lint = [
50+
"flake8",
51+
"flake8-bugbear",
52+
]
53+
dev = [
54+
#below are for building package
55+
#and running tests
56+
"pytest",
57+
"pytest-xdist",
58+
"hypothesis==6.56.4",
59+
"msprime ~= 1.3.0",
60+
"build",
61+
"twine",
62+
]
63+
64+
doc = [
65+
"jupyter-book~=0.15.1",
66+
"pydata-sphinx-theme==0.13.1",
67+
"matplotlib",
68+
"msprime",
69+
"pandas",
70+
# pyarrow will be a requirement of pandas soon.
71+
# right now, not having it raises a warning
72+
"pyarrow",
73+
"sphinx-issues",
74+
"demesdraw~=0.4.0",
75+
]
76+
3477
[project.scripts]
3578
fwdpy11 = "fwdpy11.__main__:main"
3679

@@ -69,3 +112,8 @@ before-all = "./deployment/linux_wheels/cibuildwheel.sh"
69112
archs = "x86_64"
70113
# skip = "pp* *musllinux*"
71114

115+
[tool.uv]
116+
required-environments = [
117+
"sys_platform == 'darwin' and implementation_name == 'cpython'",
118+
"sys_platform == 'linux' and implementation_name == 'cpython'",
119+
]

0 commit comments

Comments
 (0)