Skip to content

Use build-and-inspect-python-package action #10722

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

Merged

Conversation

nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Feb 9, 2023

This uses https://github.com/hynek/build-and-inspect-python-package to ensure our package is correct, both during testing and deploy.

Also include option to cancel running jobs when new commits for the same branch are pushed.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

Most lovely
I need to adopt this to my stuff now, it's awesome

Thanks to @hynek for providing

run: |
python -m build
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5
Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I'm not entirely sure that this will produce the packages in the standard location, so the Publish package to PyPI will be able to pick them up.

Looking at the action code, it builds the packages in a temporary directory: https://github.com/hynek/build-and-inspect-python-package/blob/0b1716730c334a22b313808557b14b6190896bc3/action.yml#L40

I will have to test this out in a separate repository before being confident this will work.

Copy link
Contributor

Choose a reason for hiding this comment

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

FTR you can't access them from other actions (like the upload action) because it's under /tmp. Use a download-artifact like here (you may be also able to cp -a them I guess).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, thanks, that's what I did here: pytest-dev/pytest-mock#343

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested the same approach in pytest-dev/pytest-forked#82 and it works well. 👍

@nicoddemus nicoddemus marked this pull request as draft February 10, 2023 11:42
@nicoddemus nicoddemus marked this pull request as ready for review February 12, 2023 23:27
@nicoddemus nicoddemus merged commit 27165cf into pytest-dev:main Feb 13, 2023
@nicoddemus nicoddemus deleted the use-build-and-inspect-python-package branch February 13, 2023 00:40
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Feb 13, 2023
nicoddemus added a commit that referenced this pull request Feb 14, 2023
[7.2.x] Use build-and-inspect-python-package action (#10722)
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