From 9cfa49cf1861f23422a3b7433804bc98a398fc55 Mon Sep 17 00:00:00 2001 From: Govinda Kamath Date: Fri, 24 Jul 2026 14:01:59 -0700 Subject: [PATCH 01/10] build: add wheels to pypi --- .github/workflows/main.yml | 63 +++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33efd207..188ba94a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,8 @@ on: push: branches: - master + tags: + - 'v*' pull_request: types: - opened @@ -13,7 +15,7 @@ jobs: build-and-test: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -48,6 +50,12 @@ jobs: (cd dist && pip install pybedtools-*.tar.gz && cd $TMPDIR && python -c 'import pybedtools; print(pybedtools.__file__)') conda deactivate + - name: upload sdist + if: ${{ matrix.python-version == '3.12' }} + uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist/pybedtools-*.tar.gz - name: conda env and install locally # Set up conda and install pybedtools into that env @@ -150,3 +158,56 @@ jobs: cd /tmp/docs git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" gh-pages cd $WORKDIR + + + build-wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + cibw_archs: "x86_64" + - os: ubuntu-24.04-arm + cibw_archs: "aarch64" + - os: macos-latest + cibw_archs: "arm64 x86_64" + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.21.3 + env: + CIBW_ARCHS: ${{ matrix.cibw_archs }} + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" + CIBW_SKIP: "*-win*" + CIBW_BEFORE_BUILD: "pip install 'cython>3.0' && python setup.py cythonize" + + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl + + + publish: + needs: [build-and-test, build-wheels] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + environment: pypi + permissions: + id-token: write + + steps: + - uses: actions/download-artifact@v4 + with: + pattern: wheels-* + merge-multiple: true + path: dist/ + + - uses: actions/download-artifact@v4 + with: + name: sdist + path: dist/ + + - uses: pypa/gh-action-pypi-publish@release/v1 From 0f3f4dcf8371ef923c6713dbf08322974c40223b Mon Sep 17 00:00:00 2001 From: Govinda Kamath Date: Sun, 26 Jul 2026 11:55:42 -0700 Subject: [PATCH 02/10] ci: trigger Actions test From ea79e3223b08d8db5e1035817594825401ed5431 Mon Sep 17 00:00:00 2001 From: Govinda Kamath Date: Sun, 26 Jul 2026 12:02:12 -0700 Subject: [PATCH 03/10] ci: fix setuptools missing in cibuildwheel and liblzma-dev for pysam on 3.14 --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 188ba94a..de7e486d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,6 +32,9 @@ jobs: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV echo "WORKDIR=$(pwd)" >> $GITHUB_ENV + - name: install system deps + run: sudo apt-get install -y liblzma-dev + - name: install miniforge run: | wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" @@ -182,7 +185,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" CIBW_SKIP: "*-win*" - CIBW_BEFORE_BUILD: "pip install 'cython>3.0' && python setup.py cythonize" + CIBW_BEFORE_BUILD: "pip install 'cython>3.0' setuptools && python setup.py cythonize" - uses: actions/upload-artifact@v4 with: From 21cf373a78d302b5331650336b34528be5172f03 Mon Sep 17 00:00:00 2001 From: Govinda Kamath Date: Sun, 26 Jul 2026 12:14:02 -0700 Subject: [PATCH 04/10] ci: add xz to cython-env so pysam can find liblzma via conda pkg-config --- .github/workflows/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de7e486d..4b45ec2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,9 +32,6 @@ jobs: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV echo "WORKDIR=$(pwd)" >> $GITHUB_ENV - - name: install system deps - run: sudo apt-get install -y liblzma-dev - - name: install miniforge run: | wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" @@ -47,7 +44,7 @@ jobs: # with pip to make sure it works. run: | source "${HOME}/conda/etc/profile.d/conda.sh" - conda create -p ./cython-env -y "cython>3.0" python=${{ matrix.python-version }} gxx zlib setuptools --channel conda-forge + conda create -p ./cython-env -y "cython>3.0" python=${{ matrix.python-version }} gxx zlib setuptools xz --channel conda-forge conda activate ./cython-env python setup.py clean cythonize sdist (cd dist && pip install pybedtools-*.tar.gz && cd $TMPDIR && python -c 'import pybedtools; print(pybedtools.__file__)') From 1d4ea538c21653f82bf65cd21614a64de0618291 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:11:47 -0400 Subject: [PATCH 05/10] rm publish step --- .github/workflows/main.yml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b45ec2f..b65841a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -188,26 +188,3 @@ jobs: with: name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl - - - publish: - needs: [build-and-test, build-wheels] - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') - environment: pypi - permissions: - id-token: write - - steps: - - uses: actions/download-artifact@v4 - with: - pattern: wheels-* - merge-multiple: true - path: dist/ - - - uses: actions/download-artifact@v4 - with: - name: sdist - path: dist/ - - - uses: pypa/gh-action-pypi-publish@release/v1 From a97c7e4f2a7b6139cd703613b1cd3af5ed0009f0 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Fri, 21 Aug 2026 16:55:46 -0400 Subject: [PATCH 06/10] ci: handle fork missing gh-pages --- .github/workflows/main.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b65841a0..70b70b78 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -125,17 +125,29 @@ jobs: cd /tmp/pybedtools-uncompressed/pybedtools-* (cd docs && make html) - git clone \ - --single-branch \ - --branch gh-pages "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" \ - /tmp/docs + REPO_URL="https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" + + # The gh-pages branch may not exist upstream (e.g. in a fork that has + # never published docs); if so, create a new orphan branch to work in. + if git ls-remote --exit-code --heads "$REPO_URL" gh-pages > /dev/null 2>&1; then + git clone \ + --single-branch \ + --branch gh-pages "$REPO_URL" \ + /tmp/docs + else + echo "gh-pages branch not found upstream; creating an orphan branch locally" + git clone "$REPO_URL" /tmp/docs + git -C /tmp/docs checkout --orphan gh-pages + git -C /tmp/docs rm -rf --quiet . || true + fi rm -rf /tmp/docs/* cp -r docs/build/html/* /tmp/docs touch /tmp/docs/.nojekyll cd /tmp/docs git add . - if git diff --cached --quiet; then + # with --verify HEAD, if there's no HEAD then we should commit + if git rev-parse --verify HEAD > /dev/null 2>&1 && git diff --cached --quiet; then echo "no changes, nothing to commit" else git commit -m 'update docs' From 2612996345ce5597b0daeb7082e954537a5a1747 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Fri, 21 Aug 2026 16:57:19 -0400 Subject: [PATCH 07/10] ci: bump version of various actions --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 70b70b78..3a95e367 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: git setup @@ -52,7 +52,7 @@ jobs: - name: upload sdist if: ${{ matrix.python-version == '3.12' }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: sdist path: dist/pybedtools-*.tar.gz @@ -157,7 +157,7 @@ jobs: - name: docs artifact # Upload built docs as an artifact for inspection, even on PRs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: docs path: /tmp/docs @@ -186,17 +186,17 @@ jobs: cibw_archs: "arm64 x86_64" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + uses: pypa/cibuildwheel@v4.2.0 env: CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" CIBW_SKIP: "*-win*" CIBW_BEFORE_BUILD: "pip install 'cython>3.0' setuptools && python setup.py cythonize" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl From 1a8d9c6ab7b538184ce75e01eb5caa36996ca2c5 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Fri, 21 Aug 2026 21:11:31 -0400 Subject: [PATCH 08/10] test: make test_118 more accurate counting fds --- pybedtools/test/test_issues.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pybedtools/test/test_issues.py b/pybedtools/test/test_issues.py index 810e4100..22a4901a 100644 --- a/pybedtools/test/test_issues.py +++ b/pybedtools/test/test_issues.py @@ -8,6 +8,7 @@ from pathlib import Path import pytest import psutil +import gc from pybedtools import filenames @@ -61,14 +62,29 @@ def test_issue_81(): def test_issue_118(): p = psutil.Process(os.getpid()) - start_fds = p.num_fds() a = pybedtools.example_bedtool("a.bed") b = pybedtools.example_bedtool("b.bed") + + # p.num_fds() counts anything running on the machine. Recently (Aug 2026), + # some GitHub Actions tests failed the start == stop fds because we had + # *fewer* fds. This could occur from things outside of pytest that we can't + # control cleaning up fds. The big thing we're checking here is that we + # don't leak fds during this individual test. + # + # To make this a more accurate test, do a warm-up intersection field count, + # then garbage collect, then do the loop, then garbage collect again. + a.intersect(b).field_count() + gc.collect() + start_fds = p.num_fds() for i in range(100): c = a.intersect(b) c.field_count() + gc.collect() + stop_fds = p.num_fds() - assert start_fds == stop_fds + + # Could have had GC run + assert p.num_fds() <= start_fds def test_issue_131(): From d4a333ab45687272da401d78d912335b1dfdb932 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:00:21 -0400 Subject: [PATCH 09/10] ci: better selection of sdist/docs version --- .github/workflows/main.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a95e367..4de28a84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,10 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + + include: # Used to choose which version of Python to use for docs and for sdist + - python-version: "3.12" + canonical: true runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -51,7 +55,7 @@ jobs: conda deactivate - name: upload sdist - if: ${{ matrix.python-version == '3.12' }} + if: matrix.canonical uses: actions/upload-artifact@v7 with: name: sdist @@ -114,7 +118,7 @@ jobs: - name: build-docs - if: ${{ (matrix.python-version == 3.10) }} + if: matrix.canonical # Build docs and commit to gh-pages branch. Note that no push happens # unless we're on the master branch run: | @@ -157,6 +161,7 @@ jobs: - name: docs artifact # Upload built docs as an artifact for inspection, even on PRs + if: matrix.canonical uses: actions/upload-artifact@v7 with: name: docs @@ -165,7 +170,7 @@ jobs: - name: push docs to gh-pages branch # Push docs to gh-pages if this test is running on master branch - if: ${{ (github.ref == 'refs/heads/master') && (matrix.python-version == 3.10) }} + if: (github.ref == 'refs/heads/master') && matrix.canonical run: | cd /tmp/docs git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" gh-pages From 0285930c7c2e2448eef8e8528bb4e5aa891577dd Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:34:46 -0400 Subject: [PATCH 10/10] bump version --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index bf234d24..023bdcae 100644 --- a/setup.py +++ b/setup.py @@ -71,8 +71,8 @@ MAJ = 0 MIN = 12 -REV = 0 -VERSION = '%d.%d.%d' % (MAJ, MIN, REV) +REV = '1a' +VERSION = f'{MAJ}.{MIN}.{REV}' class CleanCommand(Command):