Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Workflow: multiple py versions and arm #678

Merged
merged 7 commits into from
Jul 12, 2024
Merged

Conversation

dvmarcilio
Copy link
Collaborator

@dvmarcilio dvmarcilio commented Jul 10, 2024

Using a matrix strategy in the "Release Polyglot Piranha" workflows jobs to change python versions within [3.8; 3.12].
Moreover, adding more jobs to release for linux and macos ARM.

Successful execution of the workflow: https://github.com/uber/piranha/actions/runs/9909648923
Successful release of wheels in TestPyPi: https://test.pypi.org/project/polyglot-piranha-test/0.3.253a0/#files

pyproject.toml Outdated
@@ -1,6 +1,6 @@
[project]
name = "polyglot_piranha"
requires-python = ">=3.7"
requires-python = ">=3.8"
description = "Polyglot Piranha is a library for performing structural find and replace with deep cleanup."
authors = [
{ name = "Ameya Ketkar", email = "[email protected]" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are here, maybe remove these two author entries since the emails don't work.

Copy link
Collaborator

@stefanheule stefanheule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you very much!

run: |
pip install --upgrade maturin
- name: Build wheel with Maturin linux x86
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
maturin build --release -o dist
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this not specify a python version?

matrix:
os: [ubuntu-latest, ubuntu-20.04, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could maybe use this: fromJSON('{"linux-x86": "ubuntu-20.04", "linux-arm": "ubuntu-latest", "macos": "macos-latest"}')[matrix.target]

And lets add a comment saying "We suspect we need 20.04 due to glibc not being new enough on Debian/devpod."

release:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04, macos-latest]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about having a target here instead of the OS? because that's what we are really trying to have a matrix for: linux-x86, linux-arm, macos-arm.

run: |
pip install --upgrade maturin
- name: Build wheel with Maturin linux x86
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
maturin build --release -o dist
maturin build --sdist -o dist
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets maybe have a separate step for the source distribution? It doesn't seem like it belongs with Linux x86 necessarily.

If we do that, we can combine all matrin steps (other than src) into one.

@dvmarcilio dvmarcilio marked this pull request as ready for review July 12, 2024 14:49
- name: Build wheel with Maturin ${{ matrix.target }}
run: |
maturin build --release -o dist --target ${{ fromJSON('{"linux-x86":"x86_64-unknown-linux-gnu","linux-arm":"aarch64-unknown-linux-gnu","macos-arm":"universal2-apple-darwin"}')[matrix.target] }} -i ${{ matrix.python-version }}
- name: Build source distribution
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe say "Build source distribution (only once)" or add a comment next to the if to say why we are doing this only once.

@dvmarcilio dvmarcilio merged commit f6523af into master Jul 12, 2024
10 checks passed
@yuxincs yuxincs deleted the matrix_release branch July 15, 2024 14:29
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.

None yet

2 participants