Skip to content

test: verify python package distribution build when running make test #65

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

Open
wants to merge 2 commits into
base: release
Choose a base branch
from

Conversation

Danyal-Faheem
Copy link
Collaborator

This is a recurring issue that we usually face whenever a new release is created and didn't show up in the existing CI.

- name: Verify build
run: |
pip install --upgrade twine
python -m build
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a make command as build-pythonpackage from tutor core (python -m build --sdist) and use that here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have updated it to reflect the same way we are using it in tutor-core i.e, using make commands and adding the command as part of the make test command which is already being run in the ci.

run: |
pip install --upgrade twine
python -m build
twine check dist/*.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

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

To be consistent with gitlab flow, lets use similar pattern as twine check dist/$(echo $TUTOR_PYPI_PACKAGE | sed s/-/_/g)-*.tar.gz

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have updated it to reflect the same way we are using in tutor-core.

Pushing to pypi would occasionally fail because of breaking distribution build.
We verify the build in the github CI now so that we can mitigate those errors later on.
@Danyal-Faheem Danyal-Faheem force-pushed the danyal/twine-build-ci branch from 8ed124d to bf6ee99 Compare April 8, 2025 10:51
@DawoudSheraz DawoudSheraz moved this from Pending Triage to In review in Tutor project management Apr 8, 2025
@Danyal-Faheem
Copy link
Collaborator Author

Danyal-Faheem commented Apr 8, 2025

@DawoudSheraz The ci here is failing because the twine version needs to be >6 for this to work with hatch. However, the twine version in tutor v19.0.2 is constrained at 5.1.1.

This constraint was upgraded to 6.1.0 with this PR but that commit has not been made a part of any release yet.

Adding a constraint in cairn on twine causes a version conflict between tutor and cairn so that is not a solution here.

What do you think we should do here? Should we release a new version of tutor to incorporate the pyproject.toml migration and the subsequent requirements update?

@Danyal-Faheem Danyal-Faheem changed the title ci: add a job in test workflow to run twine check against release distribution builds test: verify python package distribution build when running make test Apr 8, 2025
@regisb
Copy link
Collaborator

regisb commented Apr 9, 2025

My 2 cents: if merging in release is a headache, I think it's fine to add this check to the main branch only. It will get merged after Teak.

@DawoudSheraz
Copy link
Contributor

@DawoudSheraz The ci here is failing because the twine version needs to be >6 for this to work with hatch. However, the twine version in tutor v19.0.2 is constrained at 5.1.1.

This constraint was upgraded to 6.1.0 with this PR but that commit has not been made a part of any release yet.

Adding a constraint in cairn on twine causes a version conflict between tutor and cairn so that is not a solution here.

What do you think we should do here? Should we release a new version of tutor to incorporate the pyproject.toml migration and the subsequent requirements update?

I am ok with releasing a new version. We will be releasing one in two weeks (to incorporate sumac.3), but we can do one today.

@Danyal-Faheem
Copy link
Collaborator Author

@DawoudSheraz I think we can wait till the next tutor release to merge as this PR isn't introducing a necessary fix.

@ahmed-arb ahmed-arb moved this from In review to Blocked in Tutor project management Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants