Skip to content

build: add wheels to pypi - #428

Open
govinda-kamath wants to merge 15 commits into
daler:masterfrom
govinda-kamath:master
Open

build: add wheels to pypi#428
govinda-kamath wants to merge 15 commits into
daler:masterfrom
govinda-kamath:master

Conversation

@govinda-kamath

@govinda-kamath govinda-kamath commented Jul 24, 2026

Copy link
Copy Markdown

Closes #427.

  • Adds a build-wheels job to CI that uses cibuildwheel to build binary wheels for:
    • manylinux and musllinux — x86_64 and aarch64 (native arm64 runner)
    • macos — arm64 and x86_64
    • Python 3.9–3.14 (also adds 3.14 to the existing build-and-test matrix)
  • Adds a publish job that runs automatically on v* tags, after both build-and-test and build-wheels pass. It publishes the sdist and all wheels to PyPI using OIDC trusted publishing (no API token needed).
  • PR development was AI assisted.

Before the first tagged release, one manual step is required on PyPI - add a Trusted Publisher for this repo.

@govinda-kamath

govinda-kamath commented Jul 26, 2026

Copy link
Copy Markdown
Author

Looks like the wheels build successfully on my fork [GHA]; but I seem to see a test failing -- dont think it should be due to this change though.

=================================== FAILURES ===================================
________________________________ test_issue_118 ________________________________

    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")
        for i in range(100):
            c = a.intersect(b)
            c.field_count()
        stop_fds = p.num_fds()
>       assert start_fds == stop_fds
E       assert 44 == 42

pybedtools/test/test_issues.py:71: AssertionError
=========================== short test summary info ============================
FAILED pybedtools/test/test_issues.py::test_issue_118 - assert 44 == 42
================== 1 failed, 554 passed, 3 xfailed in 39.02s ===================

@daler

daler commented Aug 25, 2026

Copy link
Copy Markdown
Owner

@govinda-kamath thanks for this. I decided to use a manual publishing process and so removed the publish step; most of the remaining changes here are to get things to run correctly off of your fork.

Can you try the following? This will pull the pybedtools testing wheel from test PyPI but lets pip grab other stuff from main PyPI:

pip install --extra-index-url https://test.pypi.org/simple pybedtools==0.12.1a0

Should work on most systems given the 36 wheels that are built!

@daler

daler commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Oh, and I bumped all the actions versions. Heads up for the future, LLMs use older action versions consistent with their training data that then get flagged by CI as old or deprecated.

@govinda-kamath

Copy link
Copy Markdown
Author

@daler -- works for me!! Thanks a ton for doing this!

> pip install --extra-index-url https://test.pypi.org/simple pybedtools==0.12.1a0

Looking in indexes: https://pypi.org/simple, https://test.pypi.org/simple
Collecting pybedtools==0.12.1a0
  Downloading pybedtools-0.12.1a0-cp313-cp313-macosx_11_0_arm64.whl.metadata (3.6 kB)
Collecting numpy (from pybedtools==0.12.1a0)
  Downloading numpy-2.5.2-cp313-cp313-macosx_14_0_arm64.whl.metadata (6.6 kB)
Collecting pysam (from pybedtools==0.12.1a0)
  Downloading pysam-0.24.0-cp313-cp313-macosx_11_0_arm64.whl.metadata (1.6 kB)
Collecting pandas (from pybedtools==0.12.1a0)
  Downloading pandas-3.0.5-cp313-cp313-macosx_11_0_arm64.whl.metadata (79 kB)
Collecting python-dateutil>=2.8.2 (from pandas->pybedtools==0.12.1a0)
  Downloading python_dateutil-3.9.0-py2.py3-none-any.whl.metadata (8.3 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas->pybedtools==0.12.1a0)
  Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Downloading pybedtools-0.12.1a0-cp313-cp313-macosx_11_0_arm64.whl (12.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.9/12.9 MB 7.5 MB/s  0:00:01
Downloading numpy-2.5.2-cp313-cp313-macosx_14_0_arm64.whl (5.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.3/5.3 MB 22.1 MB/s  0:00:00
Downloading pandas-3.0.5-cp313-cp313-macosx_11_0_arm64.whl (9.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.9/9.9 MB 21.8 MB/s  0:00:00
Downloading python_dateutil-3.9.0-py2.py3-none-any.whl (230 kB)
Using cached six-1.17.0-py2.py3-none-any.whl (11 kB)
Downloading pysam-0.24.0-cp313-cp313-macosx_11_0_arm64.whl (8.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.4/8.4 MB 21.2 MB/s  0:00:00
Installing collected packages: six, pysam, numpy, python-dateutil, pandas, pybedtools
Successfully installed numpy-2.5.2 pandas-3.0.5 pybedtools-0.12.1a0 pysam-0.24.0 python-dateutil-3.9.0 six-1.17.0

> python -c "from pybedtools import cbedtools; print('cbedtools extension:', cbedtools.__file__)"

cbedtools extension: /Users/govinda.kamath/miniforge3/envs/test-env/lib/python3.13/site-packages/pybedtools/cbedtools.cpython-313-darwin.so

> python -c "
import pybedtools
a = pybedtools.example_bedtool('a.bed')
b = pybedtools.example_bedtool('b.bed')
result = a.intersect(b)
print(result)
print('OK:', len(result), 'intervals')
"

chr1    155     200     feature2        0       +
chr1    155     200     feature3        0       -
chr1    900     901     feature4        0       +

OK: 3 intervals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Publish binary wheels to PyPI

2 participants