Skip to content

Commit 983b9a3

Browse files
Port the lwt tests to uv and GitHub
1 parent 3ab8566 commit 983b9a3

5 files changed

Lines changed: 63 additions & 18 deletions

File tree

.github/workflows/tests.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,15 @@ jobs:
141141
verbose: true
142142
flags: python-tests-no-jit
143143

144-
# - name: Build example LWT interface code and test
145-
# run: |
146-
# # We're assuming that the tskit C module has already
147-
# # been built, as we're testing against the local tskit version.
148-
# cd python/lwt_interface
149-
# make allchecks
150-
# uv run python -m pytest -n2
151-
152-
# - run:
153-
# name: Build cython example LWT interface code and run
154-
# command: |
155-
# cd python/lwt_interface/cython_example
156-
# make
144+
- name: Build example LWT interface code and test
145+
working-directory: python/lwt_interface/
146+
run: |
147+
make allchecks
148+
uv run --project=../ --group=test pytest -vs
149+
150+
- name: Build cython example LWT interface code and run
151+
working-directory: python/lwt_interface/cython_example
152+
run: make
157153

158154

159155
bespoke-c-test:

python/lwt_interface/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ all: cmodule
33

44
allchecks: example_c_module.c
55
CFLAGS="-std=c99 --coverage -Wall -Wextra -Werror -Wno-unused-parameter -Wno-cast-function-type" \
6-
python3 setup.py build_ext --inplace
6+
uv run --project=../ python setup.py build_ext --inplace
77

88
cmodule: example_c_module.c
9-
python3 setup.py build_ext --inplace
9+
uv run --project=../ python setup.py build_ext --inplace
1010

1111
clean:
1212
rm -f *.so *.o tags

python/lwt_interface/cython_example/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
all: compile run
22

33
compile:
4-
pip install -e . --use-pep517
4+
uv run --project=../../ --group=test-lwt setup.py build_ext --inplace
55

66
run:
7-
PYTHONPATH=../.. python -c "import example; example.main()"
7+
uv run --project=../../ --group=test-lwt python -c "import example; example.main()"
88

99
clean:
1010
rm -rf build/

python/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ test = [
8282
"zarr",
8383
]
8484

85+
test-lwt = [
86+
"cython",
87+
"pytest",
88+
"pytest-cov",
89+
]
90+
8591
docs = [
8692
"jupyter-book<2",
8793
"breathe",
@@ -94,7 +100,6 @@ docs = [
94100
"pandas",
95101
]
96102

97-
98103
wheels = [
99104
"cibuildwheel",
100105
]

python/uv.lock

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)