diff --git a/c/subprojects/kastore/VERSION.txt b/c/subprojects/kastore/VERSION.txt index 3e3c2f1e5e..eca07e4c1a 100644 --- a/c/subprojects/kastore/VERSION.txt +++ b/c/subprojects/kastore/VERSION.txt @@ -1 +1 @@ -2.1.1 +2.1.2 diff --git a/c/subprojects/kastore/kastore.h b/c/subprojects/kastore/kastore.h index fbd48cec22..3acc01aad1 100644 --- a/c/subprojects/kastore/kastore.h +++ b/c/subprojects/kastore/kastore.h @@ -157,7 +157,7 @@ to the API or ABI are introduced, i.e., the addition of a new function. The library patch version. Incremented when any changes not relevant to the to the API or ABI are introduced, i.e., internal refactors of bugfixes. */ -#define KAS_VERSION_PATCH 1 +#define KAS_VERSION_PATCH 2 /** @} */ #define KAS_HEADER_SIZE 64 diff --git a/c/subprojects/kastore/meson.build b/c/subprojects/kastore/meson.build index 1fd4b1b1d9..e635b7c945 100644 --- a/c/subprojects/kastore/meson.build +++ b/c/subprojects/kastore/meson.build @@ -26,25 +26,29 @@ if not meson.is_subproject() shared_library('kastore', 'kastore.c', install: true) executable('example', ['example.c'], link_with: kastore) - # Note: we don't declare these as meson tests because they depend on - # being run from the current working directory because of the paths - # to example files. cunit_dep = dependency('cunit') - executable('tests', ['tests.c', 'kastore.c'], dependencies: cunit_dep, + src_root = meson.project_source_root() + + tests_exe = executable('tests', ['tests.c', 'kastore.c'], dependencies: cunit_dep, c_args: ['-DMESON_VERSION="@0@"'.format(meson.project_version())]) + test('tests', tests_exe, + env: ['KAS_TEST_DATA_PREFIX=' + src_root + '/test-data/']) - executable('cpp_tests', ['cpp_tests.cpp'], link_with: kastore) + cpp_tests_exe = executable('cpp_tests', ['cpp_tests.cpp'], link_with: kastore) + test('cpp_tests', cpp_tests_exe) - executable('malloc_tests', ['malloc_tests.c', 'kastore.c'], - dependencies: cunit_dep, + malloc_tests_exe = executable('malloc_tests', ['malloc_tests.c', 'kastore.c'], + dependencies: cunit_dep, link_args:['-Wl,--wrap=malloc', '-Wl,--wrap=realloc', '-Wl,--wrap=calloc']) + test('malloc_tests', malloc_tests_exe, workdir: src_root) - executable('io_tests', ['io_tests.c', 'kastore.c'], - dependencies: cunit_dep, + io_tests_exe = executable('io_tests', ['io_tests.c', 'kastore.c'], + dependencies: cunit_dep, link_args:[ - '-Wl,--wrap=fwrite', - '-Wl,--wrap=fread', + '-Wl,--wrap=fwrite', + '-Wl,--wrap=fread', '-Wl,--wrap=fclose', '-Wl,--wrap=ftell', '-Wl,--wrap=fseek']) + test('io_tests', io_tests_exe, workdir: src_root) endif diff --git a/python/Makefile b/python/Makefile index a14783ec6b..50d0560686 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,17 +1,11 @@ -PYTHON := $(shell command -v python 2> /dev/null) -ifndef PYTHON -$(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`") -endif - all: ext3 allchecks: _tskitmodule.c CFLAGS="-std=c99 --coverage -Wall -Wextra -Werror -Wno-unused-parameter -Wno-cast-function-type" \ - python setup.py build_ext --inplace + uv run python setup.py build_ext --inplace ext3: _tskitmodule.c - - python setup.py build_ext --inplace + uv run python setup.py build_ext --inplace ctags: ctags lib/*.c lib/*.h tskit/*.py diff --git a/python/tests/test_python_c.py b/python/tests/test_python_c.py index 702010acf7..8bb5fdac1f 100644 --- a/python/tests/test_python_c.py +++ b/python/tests/test_python_c.py @@ -5073,7 +5073,7 @@ class TestModuleFunctions: def test_kastore_version(self): version = _tskit.get_kastore_version() - assert version == (2, 1, 1) + assert version == (2, 1, 2) def test_tskit_version(self): version = _tskit.get_tskit_version() @@ -5365,15 +5365,6 @@ def test_cpy_bad_node_bin_map(self): with pytest.raises(TypeError, match="cast array data"): self.pair_coalescence_quantiles(ts, node_bin_map=np.zeros(num_nodes)) - def test_cpy_bad_quantiles(self): - ts = self.example_ts() - quantiles = np.zeros(0) - with pytest.raises(ValueError, match="at least one quantile"): - self.pair_coalescence_quantiles(ts, quantiles=quantiles) - quantiles = np.zeros((3, 3)) - with pytest.raises(ValueError, match="object too deep"): - self.pair_coalescence_quantiles(ts, quantiles=quantiles) - def test_cpy_bad_inputs(self): ts = self.example_ts() with pytest.raises(TypeError, match="at most 6 keyword"): @@ -5387,6 +5378,15 @@ def test_cpy_bad_inputs(self): foo="bar", ) + def test_cpy_bad_quantiles(self): + ts = self.example_ts() + quantiles = np.zeros(0) + with pytest.raises(ValueError, match="at least one quantile"): + self.pair_coalescence_quantiles(ts, quantiles=quantiles) + quantiles = np.zeros((3, 3)) + with pytest.raises(ValueError, match="object too deep"): + self.pair_coalescence_quantiles(ts, quantiles=quantiles) + class TestPairCoalescenceRatesErrors: def example_ts(self, sample_size=10):