[med-svn] [Git][med-team/cyvcf2][upstream] New upstream version 0.31.4

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Mon Nov 3 21:28:34 GMT 2025



Étienne Mollier pushed to branch upstream at Debian Med / cyvcf2


Commits:
dd2cec80 by Étienne Mollier at 2025-11-03T22:17:06+01:00
New upstream version 0.31.4
- - - - -


9 changed files:

- .github/workflows/build.yml
- .github/workflows/wheels.yml
- CHANGES.md
- ci/osx-deps
- cyvcf2/__init__.py
- cyvcf2/cyvcf2.pyx
- cyvcf2/tests/test_reader.py
- pyproject.toml
- requirements.txt


Changes:

=====================================
.github/workflows/build.yml
=====================================
@@ -53,23 +53,25 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        os: [ubuntu-22.04, macos-12]
+        os: [ubuntu-22.04, macos-13]
         python-version:
-          ["pypy3.10", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
+          ["pypy3.10", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
         exclude:
           # Run only the latest versions on macOS and windows
-          - os: macos-12
+          - os: macos-13
             python-version: "pypy3.10"
-          - os: macos-12
+          - os: macos-13
             python-version: "3.7"
-          - os: macos-12
+          - os: macos-13
             python-version: "3.8"
-          - os: macos-12
+          - os: macos-13
             python-version: "3.9"
-          - os: macos-12
+          - os: macos-13
             python-version: "3.10"
-          - os: macos-12
+          - os: macos-13
             python-version: "3.11"
+          - os: macos-12
+            python-version: "3.12"
 
     steps:
       - uses: actions/checkout at v4
@@ -185,7 +187,7 @@ jobs:
     runs-on: ubuntu-22.04
     strategy:
       matrix:
-        python-version: ["3.12"]
+        python-version: ["3.14"]
 
     steps:
       - uses: actions/checkout at v4


=====================================
.github/workflows/wheels.yml
=====================================
@@ -4,6 +4,7 @@ on:
   push:
     branches:
       - main
+      - wheels
     tags:
       - "v*.*.*"
   workflow_dispatch:
@@ -27,20 +28,17 @@ jobs:
           - [ubuntu-22.04, musllinux_x86_64]
           - [ubuntu-22.04, manylinux_aarch64]
           - [ubuntu-22.04, musllinux_aarch64]
-          - [macos-12, macosx_x86_64]
+          - [macos-13, macosx_x86_64]
           - [macos-14, macosx_arm64]
-        python-version: [pp310, cp37, cp38, cp39, cp310, cp311, cp312]
+        python-version: [pp310, cp38, cp39, cp310, cp311, cp312, cp313, cp314]
         exclude:
-          # pp310, cp37, cp38 on musllinux is not support
+          # pp310, cp38 on musllinux is not support
           # cp39, cp310 on musllinux_aarch64, wheel building may hangup, ignore it
-          - buildplat: [ubuntu-22.04, musllinux_x86_64]
-            python-version: cp37
+          # drop 37 so we can use newer cibuildwheel
           - buildplat: [ubuntu-22.04, musllinux_x86_64]
             python-version: cp38
           - buildplat: [ubuntu-22.04, musllinux_x86_64]
             python-version: pp310
-          - buildplat: [ubuntu-22.04, musllinux_aarch64]
-            python-version: cp37
           - buildplat: [ubuntu-22.04, musllinux_aarch64]
             python-version: cp38
           - buildplat: [ubuntu-22.04, musllinux_aarch64]
@@ -49,14 +47,6 @@ jobs:
             python-version: cp310
           - buildplat: [ubuntu-22.04, musllinux_aarch64]
             python-version: pp310
-          # cp37 on macos arm64 is not supported
-          - buildplat: [macos-14, macosx_arm64]
-            python-version: cp37
-          # cp38 pp310 on macos arm64 have some problem
-          - buildplat: [macos-14, macosx_arm64]
-            python-version: cp38
-          - buildplat: [macos-14, macosx_arm64]
-            python-version: pp310
 
     steps:
       - uses: actions/checkout at v4
@@ -68,7 +58,7 @@ jobs:
         uses: docker/setup-qemu-action at v3
 
       - name: Build wheels
-        uses: pypa/cibuildwheel at v2.18.1
+        uses: pypa/cibuildwheel at v3.1.4
         with:
           package-dir: .
           output-dir: wheelhouse
@@ -76,6 +66,8 @@ jobs:
         env:
           # select
           CIBW_BUILD: ${{ matrix.python-version }}-${{ matrix.buildplat[1] }}
+          CIBW_ENABLE: pypy
+          CIBW_PRERELEASE_PYTHONS: 1
 
           # linux
           CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
@@ -118,7 +110,7 @@ jobs:
       - uses: actions/setup-python at v5
         name: Install Python
         with:
-          python-version: "3.12"
+          python-version: "3.14"
 
       - name: Install dependencies
         run: |


=====================================
CHANGES.md
=====================================
@@ -1,3 +1,9 @@
+# v0.31.4
++ add python 3.14 wheels (thanks @benjeffery #321)
+
+# v0.31.2
++ build fix for OSX (thanks @benjeffery #319)
+
 # v0.31.1
 + build fix for numpy 2.0.0 (#307, #308 thanks @aryarm for fixing build)
 


=====================================
ci/osx-deps
=====================================
@@ -2,24 +2,33 @@
 
 set -euo pipefail
 
-# same with python
-export MACOSX_DEPLOYMENT_TARGET=10.9
+export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-10.9}
+ARCHS="arm64;x86_64"
+COMMON_CMAKE_ARGS=(
+  -DCMAKE_OSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}"
+  -DCMAKE_OSX_ARCHITECTURES="${ARCHS}"
+  -DCMAKE_BUILD_TYPE=Release
+)
 
 brew install automake libdeflate
 brew unlink xz
 
-# build liblzma and libdelfate for deployment target 10.9
+# build liblzma and libdeflate for deployment target
 
 XZ_VERSION=5.4.6
-curl -L -o xz-$XZ_VERSION.tar.gz "https://github.com/tukaani-project/xz/releases/download/v$XZ_VERSION/xz-$XZ_VERSION.tar.gz"
-tar -xf xz-$XZ_VERSION.tar.gz
-cd xz-$XZ_VERSION
-cmake -B build && cmake --build build
-cd ./build && sudo make install
+curl -L -o "xz-${XZ_VERSION}.tar.gz" "https://github.com/tukaani-project/xz/releases/download/v${XZ_VERSION}/xz-${XZ_VERSION}.tar.gz"
+tar -xf "xz-${XZ_VERSION}.tar.gz"
+pushd "xz-${XZ_VERSION}" >/dev/null
+cmake -S . -B build "${COMMON_CMAKE_ARGS[@]}"
+cmake --build build --config Release --parallel
+sudo cmake --install build --config Release
+popd >/dev/null
 
 LIBDEFLATE_VERSION=1.20
-curl -L -o libdeflate-v"$LIBDEFLATE_VERSION".tar.gz https://github.com/ebiggers/libdeflate/archive/refs/tags/v"$LIBDEFLATE_VERSION".tar.gz
-tar xzf libdeflate-v"$LIBDEFLATE_VERSION".tar.gz
-cd libdeflate-"$LIBDEFLATE_VERSION"
-cmake -B build && cmake --build build
-cd ./build && sudo make install
+curl -L -o "libdeflate-v${LIBDEFLATE_VERSION}.tar.gz" "https://github.com/ebiggers/libdeflate/archive/refs/tags/v${LIBDEFLATE_VERSION}.tar.gz"
+tar -xf "libdeflate-v${LIBDEFLATE_VERSION}.tar.gz"
+pushd "libdeflate-${LIBDEFLATE_VERSION}" >/dev/null
+cmake -S . -B build "${COMMON_CMAKE_ARGS[@]}"
+cmake --build build --config Release --parallel
+sudo cmake --install build --config Release
+popd >/dev/null


=====================================
cyvcf2/__init__.py
=====================================
@@ -2,4 +2,4 @@ from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
                      par_het)
 Reader = VCFReader = VCF
 
-__version__ = "0.31.1"
+__version__ = "0.31.4"


=====================================
cyvcf2/cyvcf2.pyx
=====================================
@@ -293,6 +293,12 @@ cdef class VCF(HTSFile):
         if threads is not None:
             self.set_threads(threads)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type, value, tb):
+        self.close()
+
     def set_threads(self, int n):
         v = hts_set_threads(self.hts, n)
         if v < 0:
@@ -397,7 +403,7 @@ cdef class VCF(HTSFile):
         description: str
              description of added line.
         """
-        ret = bcf_hdr_append(self.hdr, "##INFO=<ID={id},Number={number},Type={type},Description=\"{description}\">".format(id=id, type=type, number=number, description=description))
+        ret = bcf_hdr_append(self.hdr, "##INFO=<ID={id},Number={number},Type={type},Description=\"{description}\">".format(id=id, type=type, number=number, description=description).encode())
         if ret != 0:
             raise Exception("unable to update to header: %d", ret)
         ret = bcf_hdr_sync(self.hdr)


=====================================
cyvcf2/tests/test_reader.py
=====================================
@@ -1410,3 +1410,9 @@ def test_num_records_no_index(path):
     vcf = VCF(os.path.join(HERE, path))
     with pytest.raises(ValueError, match="must be indexed"):
         vcf.num_records
+
+def test_reader_context_manager():
+    with VCF(VCF_PATH) as vcf:
+        pass
+    with pytest.raises(Exception, match="attempt to iterate over closed"):
+        next(vcf)


=====================================
pyproject.toml
=====================================
@@ -2,7 +2,8 @@
 requires = [
   "setuptools",
   "wheel",
-  "cython>=0.23.3",
+  'cython>=0.23.3,<3; python_version < "3.9"',
+  'cython>=3; python_version >= "3.9"',
   'oldest-supported-numpy; os_name != "nt" and python_version < "3.9"',
   'numpy; os_name == "nt" and python_version < "3.9"',
   'numpy>=2.0.0; python_version >= "3.9"',


=====================================
requirements.txt
=====================================
@@ -1,4 +1,5 @@
-cython>=0.23.3
+cython>=0.23.3,<3; python_version < "3.9"
+cython>=3; python_version >= "3.9"
 coloredlogs
 click
 setuptools



View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/dd2cec80fb6028998f26082b17c09f66907896b7

-- 
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/dd2cec80fb6028998f26082b17c09f66907896b7
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20251103/a71e480d/attachment-0001.htm>


More information about the debian-med-commit mailing list