From 0b872afc92423a155f74e5137580f36a4bcb8873 Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Wed, 23 Oct 2024 12:08:32 +0100 Subject: [PATCH 1/2] Unpin numpy and bump ICF metadata version Closes #258 --- CHANGELOG.md | 7 +++++++ bio2zarr/vcf2zarr/icf.py | 2 +- pyproject.toml | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b3b38..ecabe9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.1.2 2024-XX-XX + +Breaking changes + +- ICF metadata format version bumped to ensure long-term compatility between numpy 1.26.x + and numpy >= 2. Existing ICFs will need to be recreated. + # 0.1.1 2024-06-19 Maintenance release: diff --git a/bio2zarr/vcf2zarr/icf.py b/bio2zarr/vcf2zarr/icf.py index 7646826..1295209 100644 --- a/bio2zarr/vcf2zarr/icf.py +++ b/bio2zarr/vcf2zarr/icf.py @@ -110,7 +110,7 @@ class VcfPartition: num_records: int = -1 -ICF_METADATA_FORMAT_VERSION = "0.3" +ICF_METADATA_FORMAT_VERSION = "0.4" ICF_DEFAULT_COMPRESSOR = numcodecs.Blosc( cname="zstd", clevel=7, shuffle=numcodecs.Blosc.NOSHUFFLE ) diff --git a/pyproject.toml b/pyproject.toml index 42f976d..d911bcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,9 @@ authors = [ {name = "sgkit Developers", email = "project@sgkit.dev"}, ] dependencies = [ - "numpy < 2", + # Pin numpy to >= 1.26 because this enables ICF files to be supported + # across numpy 1 and 2 (due to pickle format) + "numpy >= 1.26", "zarr >= 2.17,< 3", "click", "tabulate", From 4dd205e06ebe53634b7442fdec0aab1e3a70f013 Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Wed, 23 Oct 2024 12:40:35 +0100 Subject: [PATCH 2/2] Run tests on numpy 1 and numpy 2 Closes #256 --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5060aa3..deeebf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,3 +109,26 @@ jobs: vcfpartition --help python -m bio2zarr vcfpartition --help + test-numpy-version: + name: Test numpy versions + runs-on: ubuntu-latest + strategy: + matrix: + numpy: ["==1.26", ">=2"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install '.[dev]' + - name: Install numpy${{ matrix.numpy }} + run: | + python -m pip install 'numpy${{ matrix.numpy }}' + - name: Run tests + run: | + # We just run the CLI tests here because it doesn't require other upstream + # packages like sgkit (which are tangled up with the numpy 2 dependency) + python -m pytest tests/test_cli.py