From b789e2b8d84ae7f3dd926abd67727b5a2d623c1d Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Tue, 3 Feb 2026 23:11:03 +0000 Subject: [PATCH 1/9] Fix CI and other issues * Pin pandas <3.0 in requirements and pyproject * Split NumPy constraints by Python version for Apple M4 error * Make xr.concat data_vars explicit to silence FutureWarning * Expand zarr error regex to accept "contains data" * Ignore .hypothesis in pytest collection --- pyproject.toml | 7 ++++--- requirements-numpy1.txt | 2 +- requirements.txt | 5 +++-- sgkit/tests/io/test_dataset.py | 2 +- sgkit/tests/test_association.py | 6 +++++- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7ef0d03c4..bdcfc1c01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,8 @@ classifiers = [ urls = { Homepage = "https://github.com/sgkit-dev/sgkit" } requires-python = ">=3.10" dependencies = [ - "numpy < 2.2", + "numpy < 2.3; python_version < \"3.11\"", + "numpy >= 2.3.5, < 2.4; python_version >= \"3.11\"", # M4 chip error "xarray < 2025.03.1", "dask[array,dataframe] >= 2022.01.0, <= 2024.8.0", "scipy < 1.16", @@ -30,7 +31,7 @@ dependencies = [ "numba", "fsspec != 2021.6.*", "scikit-learn", - "pandas", + "pandas < 3.0", "setuptools >= 41.2", # For pkg_resources ] dynamic = ["version"] @@ -69,7 +70,7 @@ fail_under = 100 [tool.pytest.ini_options] addopts = "--doctest-modules --ignore=validation --cov-fail-under=100" -norecursedirs = [".eggs", "build", "docs"] +norecursedirs = [".eggs", "build", "docs", ".hypothesis"] filterwarnings = ["error", "ignore::DeprecationWarning"] diff --git a/requirements-numpy1.txt b/requirements-numpy1.txt index b4da65449..81c8c17df 100644 --- a/requirements-numpy1.txt +++ b/requirements-numpy1.txt @@ -6,4 +6,4 @@ numba zarr >= 2.10.0, != 2.11.0, != 2.11.1, != 2.11.2, < 3 fsspec != 2021.6.* scikit-learn -pandas +pandas < 3.0 diff --git a/requirements.txt b/requirements.txt index 8b130d40d..5765240b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -numpy < 2.2 +numpy < 2.3; python_version < "3.11" +numpy >= 2.3.5, < 2.4; python_version >= "3.11" xarray < 2025.03.1 dask[array,dataframe] >= 2023.01.0, <= 2024.8.0 scipy < 1.16 @@ -6,4 +7,4 @@ numba zarr >= 2.10.0, != 2.11.0, != 2.11.1, != 2.11.2, < 3 fsspec != 2021.6.* scikit-learn -pandas +pandas < 3.0 diff --git a/sgkit/tests/io/test_dataset.py b/sgkit/tests/io/test_dataset.py index cb1a26405..ce3ce6210 100644 --- a/sgkit/tests/io/test_dataset.py +++ b/sgkit/tests/io/test_dataset.py @@ -58,7 +58,7 @@ def test_save_unequal_chunks_error(): # Normal zarr errors shouldn't be caught with pytest.raises( (FileExistsError, ValueError), - match="(path '' contains an array|is not empty)", + match="(path '' contains an array|is not empty|contains data)", ): save_dataset(ds, {".zarray": ""}) diff --git a/sgkit/tests/test_association.py b/sgkit/tests/test_association.py index d40aa3f01..aad1bef19 100644 --- a/sgkit/tests/test_association.py +++ b/sgkit/tests/test_association.py @@ -254,7 +254,11 @@ def run(traits: Sequence[str]) -> Dataset: traits = [f"trait_{i}" for i in range(ds.attrs["n_trait"])] # Run regressions on individual traits and concatenate resulting statistics - dfr_single = xr.concat([run([t]) for t in traits], dim="traits").to_dataframe() + dfr_single = xr.concat( + [run([t]) for t in traits], + dim="traits", + data_vars="all", + ).to_dataframe() # Run regressions on all traits simulatenously dfr_multi: DataFrame = run(traits).to_dataframe() pd.testing.assert_frame_equal(dfr_single, dfr_multi) From 44b99d955d915c4a53fefa3b4dd9a0f69846a47b Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Wed, 4 Feb 2026 15:13:43 +0000 Subject: [PATCH 2/9] Update xarray intersphinx link --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 0ca62e01a..444618a25 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -123,7 +123,7 @@ def filter(self, record: pylogging.LogRecord) -> bool: intersphinx_mapping = dict( dask=("https://docs.dask.org/en/stable/", None), - xarray=("https://xarray.pydata.org/en/stable/", None), + xarray=("https://docs.xarray.dev/en/stable/", None), zarr=("https://zarr.readthedocs.io/en/stable", None), numpy=("https://numpy.org/doc/stable/", None), python=("https://docs.python.org/3", None), From 925e6ddf6d9aef0ee30d3abc8523ab1f94bc1d1c Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Wed, 4 Feb 2026 15:30:00 +0000 Subject: [PATCH 3/9] Drop Python 3.10 and NumPy1 support --- .github/workflows/benchmark.yml | 2 +- .github/workflows/build-gpu.yml | 2 +- .github/workflows/build-numpy-1.yml | 30 ----------------------------- .github/workflows/build.yml | 2 +- .github/workflows/upstream.yml | 2 +- .github/workflows/wheels.yml | 6 +++--- .github/workflows/windows.yml | 2 +- docs/getting_started.rst | 2 +- pyproject.toml | 7 +++---- requirements-numpy1-dev.txt | 23 ---------------------- requirements-numpy1.txt | 9 --------- requirements.txt | 4 ++-- 12 files changed, 14 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/build-numpy-1.yml delete mode 100644 requirements-numpy1-dev.txt delete mode 100644 requirements-numpy1.txt diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 091b2a1dd..dc6172959 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Install dependencies run: | sudo apt update -y diff --git a/.github/workflows/build-gpu.yml b/.github/workflows/build-gpu.yml index 3292de308..f850cc57d 100644 --- a/.github/workflows/build-gpu.yml +++ b/.github/workflows/build-gpu.yml @@ -17,7 +17,7 @@ jobs: shell: bash -l {0} strategy: matrix: - python-version: ["3.10"] + python-version: ["3.11"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/build-numpy-1.yml b/.github/workflows/build-numpy-1.yml deleted file mode 100644 index 329a10c40..000000000 --- a/.github/workflows/build-numpy-1.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build NumPy 1 - -on: - push: - pull_request: - -jobs: - build: - # Scheduled runs only on the origin org - if: (github.event_name == 'schedule' && github.repository_owner == 'sgkit-dev') || (github.event_name != 'schedule') - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10", "3.11"] - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-numpy1.txt -r requirements-numpy1-dev.txt - # - name: Run pre-commit - # uses: pre-commit/action@v3.0.1 - - name: Test with pytest and coverage - run: | - pytest -v --cov=sgkit --cov-report=term-missing diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a02613df..79de8187a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index a57d0f92a..0c4cf46aa 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e94e4e451..2216bd0b7 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] + python-version: ["3.11"] steps: - uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.10", "3.11"] + python-version: ["3.11", "3.12"] runs-on: ${{ matrix.os }} steps: # checkout repo to subdirectory to get access to scripts @@ -76,7 +76,7 @@ jobs: needs: ['build'] strategy: matrix: - python-version: ["3.10"] + python-version: ["3.11"] steps: # checkout repo to subdirectory to get access to scripts - uses: actions/checkout@v4 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b9c9cdd90..6b1463485 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ["3.10"] + python-version: ["3.11"] steps: - uses: actions/checkout@v4 diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 7656264b6..75d5c493b 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -10,7 +10,7 @@ Getting Started Installation ------------ -You can install sgkit with pip. Python 3.10, 3.11, or 3.12 is required:: +You can install sgkit with pip. Python 3.11 or 3.12 is required:: $ pip install sgkit diff --git a/pyproject.toml b/pyproject.toml index bdcfc1c01..bac546e5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,16 +14,15 @@ classifiers = [ "Intended Audience :: Science/Research", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", ] urls = { Homepage = "https://github.com/sgkit-dev/sgkit" } -requires-python = ">=3.10" +requires-python = ">=3.11" dependencies = [ - "numpy < 2.3; python_version < \"3.11\"", - "numpy >= 2.3.5, < 2.4; python_version >= \"3.11\"", # M4 chip error + "numpy >= 2.3.5; sys_platform == \"darwin\"", # Apple ARM chip error + "numpy >= 2.0; sys_platform != \"darwin\"", "xarray < 2025.03.1", "dask[array,dataframe] >= 2022.01.0, <= 2024.8.0", "scipy < 1.16", diff --git a/requirements-numpy1-dev.txt b/requirements-numpy1-dev.txt deleted file mode 100644 index ed0c5b629..000000000 --- a/requirements-numpy1-dev.txt +++ /dev/null @@ -1,23 +0,0 @@ -callee -pre-commit -pytest -pytest-cov -pytest-datadir -pytest-mock -hypothesis -scikit-allel -statsmodels -msprime>=1.0 -scikit-learn -partd -bed-reader -rechunker -cbgen < 1.0.5 -bio2zarr[vcf]; platform_system != "Windows" -yarl -matplotlib -asv -networkx -aiohttp -requests -graphviz diff --git a/requirements-numpy1.txt b/requirements-numpy1.txt deleted file mode 100644 index 81c8c17df..000000000 --- a/requirements-numpy1.txt +++ /dev/null @@ -1,9 +0,0 @@ -numpy < 2 -xarray < 2025.03.1 -dask[array,dataframe] >= 2023.01.0, <= 2024.8.0 -scipy < 1.16 -numba -zarr >= 2.10.0, != 2.11.0, != 2.11.1, != 2.11.2, < 3 -fsspec != 2021.6.* -scikit-learn -pandas < 3.0 diff --git a/requirements.txt b/requirements.txt index 5765240b9..49c86f1bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -numpy < 2.3; python_version < "3.11" -numpy >= 2.3.5, < 2.4; python_version >= "3.11" +numpy >= 2.3.5; sys_platform == "darwin" +numpy >= 2.0; sys_platform != "darwin" xarray < 2025.03.1 dask[array,dataframe] >= 2023.01.0, <= 2024.8.0 scipy < 1.16 From 6f83908aeaeaed19db81b2685de2a4797d1183c4 Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Wed, 4 Feb 2026 15:35:04 +0000 Subject: [PATCH 4/9] Filter runtime warnings in tests --- sgkit/tests/test_distance.py | 3 +++ sgkit/tests/test_testing.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sgkit/tests/test_distance.py b/sgkit/tests/test_distance.py index bcd42f16a..67b99475e 100644 --- a/sgkit/tests/test_distance.py +++ b/sgkit/tests/test_distance.py @@ -143,6 +143,9 @@ def test_distance_ndarray() -> None: pytest.param("correlation", correlation, "i8", "gpu", marks=pytest.mark.gpu), ], ) +@pytest.mark.filterwarnings( + "ignore:invalid value encountered in correlation_reduce_cpu:RuntimeWarning" +) def test_missing_values( metric: MetricTypes, metric_func: typing.Callable[[ArrayLike, ArrayLike], np.float64], diff --git a/sgkit/tests/test_testing.py b/sgkit/tests/test_testing.py index 20de6d662..e6afdbbbc 100644 --- a/sgkit/tests/test_testing.py +++ b/sgkit/tests/test_testing.py @@ -10,6 +10,9 @@ @pytest.mark.filterwarnings( "ignore::UserWarning" ) # codec `vlen-utf8` not in Zarr v3 spec` +@pytest.mark.filterwarnings( + "ignore:The data type .* does not have a Zarr V3 specification.*" +) def test_simulate_genotype_call_dataset__zarr(tmp_path): path = str(tmp_path / "ds.zarr") ds = simulate_genotype_call_dataset(n_variant=10, n_sample=10) From 00ad55143b0d21a7e62125c31eeb4d5e051ed755 Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Wed, 4 Feb 2026 15:40:10 +0000 Subject: [PATCH 5/9] Fix Windows conda install --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6b1463485..43fa2321f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -30,8 +30,8 @@ jobs: shell: bash -l {0} # conda can't install all dev tools, so we need to split it between conda and pip run: | - conda install --file requirements.txt msprime - pip install -r requirements-dev.txt + conda install msprime + pip install -r requirements.txt -r requirements-dev.txt - name: Test with pytest # activate conda shell: bash -l {0} From badc8c10c6a43a7e88ab00d09b938886818c649b Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Fri, 6 Feb 2026 14:45:40 +0000 Subject: [PATCH 6/9] Use PEP 604 union syntax in docs --- docs/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 444618a25..fbf1f4aaf 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,6 +60,9 @@ *[p.stem for p in (HERE / "extensions").glob("*.py")], ] +# Prefer PEP 604 union syntax (X | Y) to avoid unresolved typing.Union references. +always_use_bars_union = True + # Enable math notation in mystnb myst_enable_extensions = [ "amsmath", From 52c3c26ef2eec883e022e4e9d0f4d3bf7db3f8a8 Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Fri, 6 Feb 2026 14:45:40 +0000 Subject: [PATCH 7/9] Relax Sphinx requirement --- requirements-doc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-doc.txt b/requirements-doc.txt index 2ed139147..e0513f475 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -1,7 +1,7 @@ myst_nb pydata-sphinx-theme -sphinx==6.2.1 -sphinx_autodoc_typehints>=1.14.0 +sphinx < 9.0.0 +sphinx_autodoc_typehints sphinx-copybutton scanpydoc ipython From 43cfeb64bb2d455751ef8d0d546b470849f29862 Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Thu, 5 Feb 2026 01:42:01 +0000 Subject: [PATCH 8/9] Update mergify Python targets --- .mergify.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index 30abd30fc..dcac4561c 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -2,9 +2,9 @@ queue_rules: - name: default conditions: - base=main - - status-success=build (3.10) - status-success=build (3.11) - - status-success=win_build (3.10) + - status-success=build (3.12) + - status-success=win_build (3.11) - approved-reviews-by=@sgkit-dev/committers - "#approved-reviews-by>=1" - label=auto-merge @@ -13,9 +13,9 @@ pull_request_rules: - name: automatic merge conditions: - base=main - - status-success=build (3.10) - status-success=build (3.11) - - status-success=win_build (3.10) + - status-success=build (3.12) + - status-success=win_build (3.11) - approved-reviews-by=@sgkit-dev/committers - "#approved-reviews-by>=1" - label=auto-merge From 021e4ca1d1673d985f510617de4b8fe7c61b2411 Mon Sep 17 00:00:00 2001 From: Ao Zhang Date: Thu, 5 Feb 2026 15:27:22 +0000 Subject: [PATCH 9/9] Temporary disable notebook execution due to missing link --- docs/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index fbf1f4aaf..a71360b68 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -69,6 +69,10 @@ "dollarmath", ] +# Temporary disable notebook execution during docs build (see issue #1332): +# https://github.com/sgkit-dev/sgkit/issues/1332 +nb_execution_mode = "off" + extlinks = { "issue": ("https://github.com/sgkit-dev/sgkit/issues/%s", "GH %s"), "pr": ("https://github.com/sgkit-dev/sgkit/pull/%s", "PR %s"),