Skip to content

Feature Request: Publish binary wheels to PyPI #427

Description

@govinda-kamath

Thank you for this great package!

Currently, the CI workflow builds a source distribution (sdist) via python setup.py clean cythonize sdist and validates it with a local pip install. However, no binary wheels are built or published to PyPI, which means every pip install pybedtools triggers a from-source compile on the user's machine.

Proposed solution

Use cibuildwheel to build manylinux wheels for x86_64 and aarch64, plus macOS wheels, as part of the existing GitHub Actions workflow, then publish both the sdist and wheels to PyPI on tagged releases.

A minimal addition to main.yml would look something like:

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  # native aarch64 runner
          cibw_archs: "aarch64"
        - os: macos-latest
          cibw_archs: "arm64 x86_64"

  steps:
    - uses: actions/checkout@v4

    - name: Build wheels
      uses: pypa/cibuildwheel@v2.x
      env:
        CIBW_ARCHS: ${{ matrix.cibw_archs }}
        CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
        CIBW_SKIP: "*-win32 *-musllinux*"
        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')
  steps:
    - uses: actions/download-artifact@v4
      with:
        pattern: wheels-*
        merge-multiple: true
        path: dist/
    # download sdist artifact here too
    - uses: pypa/gh-action-pypi-publish@release/v1

Happy to help put together a PR if the maintainers are open to it!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions