Skip to content

Build wheels for BIOM and modernize package metadata#996

Merged
wasade merged 28 commits intobiocore:masterfrom
mataton:wheels
Jul 10, 2025
Merged

Build wheels for BIOM and modernize package metadata#996
wasade merged 28 commits intobiocore:masterfrom
mataton:wheels

Conversation

@mataton
Copy link
Copy Markdown
Collaborator

@mataton mataton commented Jul 1, 2025

This PR builds off of the work done by @schlich in PR #994 . Thank you for the initial effort! The work has been expanded to further fit the build requirements of the scikit-bio team.

There is still some ironing out of details, and general cleanup, but it should be more or less functional at this point.

Wheels are built on every pull request, but only published on pushes with tagged commits (releases).

The workflow builds the wheels, then installs the package from the wheel and runs unit tests to ensure that the code from the wheel works as intended.

UPDATE:

This should be good to go now. Here's what I've done:

wheels.yml

This file contains code for building source distributions and wheels, as well as publishing them to PyPI. The workflow is triggered like so:

on:
  pull_request:
    branches: [ master ]
  workflow_call:
  workflow_dispatch:

meaning it will trigger on PR's, and can also be triggered manually (workflow_dispatch) or by other workflows (workflow_call). This is important because the release.yml file calls the wheels.yml workflow.

In the wheels workflow, wheels are built and then unit tests are run against the wheels to ensure everything works correctly.

release.yml

This file is only triggered on pushes with tagged commits (ie. releases). It will simply call the wheels.yml workflow, and the upload_pypi job from that workflow will run because this if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') will evaluate to true.

pyproject.toml

This file contains configuration options and the metadata information that was formerly stored in setup.py.

Considerations

I'm not sure if it would be better to combine the release.yml and wheels.yml into a single file. To do so all that would have to happen is add:

  push:
    tags:
      - '*'

to the wheels.yml file and delete release.yml. For now I've kept them separate.

To sum up, wheels are built on each PR to ensure they work, but things are only published on new releases.

Comment thread pyproject.toml Outdated
@mataton mataton mentioned this pull request Jul 2, 2025
@mataton mataton changed the title WIP: Build wheels for BIOM and modernize package metadata Build wheels for BIOM and modernize package metadata Jul 2, 2025
@mataton mataton requested a review from wasade July 2, 2025 20:06
@wasade
Copy link
Copy Markdown
Member

wasade commented Jul 9, 2025

Do we need to build per PR? We have limited GitHub Action cycles, and it looks to add a lot of time to CI. Why not just at release?

Comment thread .github/workflows/wheels.yml Outdated
Comment thread .github/workflows/wheels.yml
@mataton
Copy link
Copy Markdown
Collaborator Author

mataton commented Jul 9, 2025

@wasade I suppose it isn't necessary to run for every single PR. We could only build wheels on release, but there might be build issues that aren't caught which are introduced between releases. I think maybe a middle path could be to build wheels on releases, and also build wheels on PR's which affect any files related to the build process (setup.py, pyproject.toml, cython files, and the .yml files themselves). If a PR didn't change any of those files, the wheels workflow wouldn't run. Would you be okay with that or do you want to only build on release?

@wasade
Copy link
Copy Markdown
Member

wasade commented Jul 9, 2025

I think that's a great idea

@qiyunzhu
Copy link
Copy Markdown
Contributor

qiyunzhu commented Jul 9, 2025

@wasade @mataton Regarding macos version: macos-latest maps to macos-14. I received an email from GitHub days ago saying that it will soon be mapped to macos-15. The email also says I don't need to do anything. Regardless, they are both ARM64 based systems. Also, macos permit cross-compilation between architecture. Even if we only build on macos-13, it will generate both X86_64 and ARM64 wheels, although the latter is slower. So I think this versioning thing isn't important.

@wasade wasade merged commit d3df9ac into biocore:master Jul 10, 2025
60 checks passed
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.

4 participants