Skip to content

Commit f013feb

Browse files
Update low-level tests and Makefile for uv
1 parent 270e3e6 commit f013feb

2 files changed

Lines changed: 12 additions & 18 deletions

File tree

python/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
PYTHON := $(shell command -v python 2> /dev/null)
2-
ifndef PYTHON
3-
$(error "python is not available via the `python` executable. If you have python only via `python3` you may need to `apt install python-is-python3`")
4-
endif
5-
61
all: ext3
72

83
allchecks: _tskitmodule.c
94
CFLAGS="-std=c99 --coverage -Wall -Wextra -Werror -Wno-unused-parameter -Wno-cast-function-type" \
10-
python setup.py build_ext --inplace
5+
uv run python setup.py build_ext --inplace
116

127
ext3: _tskitmodule.c
13-
14-
python setup.py build_ext --inplace
8+
uv run python setup.py build_ext --inplace
159

1610
ctags:
1711
ctags lib/*.c lib/*.h tskit/*.py

python/tests/test_python_c.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5073,7 +5073,7 @@ class TestModuleFunctions:
50735073

50745074
def test_kastore_version(self):
50755075
version = _tskit.get_kastore_version()
5076-
assert version == (2, 1, 1)
5076+
assert version == (2, 1, 2)
50775077

50785078
def test_tskit_version(self):
50795079
version = _tskit.get_tskit_version()
@@ -5365,15 +5365,6 @@ def test_cpy_bad_node_bin_map(self):
53655365
with pytest.raises(TypeError, match="cast array data"):
53665366
self.pair_coalescence_quantiles(ts, node_bin_map=np.zeros(num_nodes))
53675367

5368-
def test_cpy_bad_quantiles(self):
5369-
ts = self.example_ts()
5370-
quantiles = np.zeros(0)
5371-
with pytest.raises(ValueError, match="at least one quantile"):
5372-
self.pair_coalescence_quantiles(ts, quantiles=quantiles)
5373-
quantiles = np.zeros((3, 3))
5374-
with pytest.raises(ValueError, match="object too deep"):
5375-
self.pair_coalescence_quantiles(ts, quantiles=quantiles)
5376-
53775368
def test_cpy_bad_inputs(self):
53785369
ts = self.example_ts()
53795370
with pytest.raises(TypeError, match="at most 6 keyword"):
@@ -5387,6 +5378,15 @@ def test_cpy_bad_inputs(self):
53875378
foo="bar",
53885379
)
53895380

5381+
def test_cpy_bad_quantiles(self):
5382+
ts = self.example_ts()
5383+
quantiles = np.zeros(0)
5384+
with pytest.raises(ValueError, match="at least one quantile"):
5385+
self.pair_coalescence_quantiles(ts, quantiles=quantiles)
5386+
quantiles = np.zeros((3, 3))
5387+
with pytest.raises(ValueError, match="object too deep"):
5388+
self.pair_coalescence_quantiles(ts, quantiles=quantiles)
5389+
53905390

53915391
class TestPairCoalescenceRatesErrors:
53925392
def example_ts(self, sample_size=10):

0 commit comments

Comments
 (0)