Skip to content

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

Merged
nicoddemus merged 7 commits into
pytest-dev:mainfrom
nicoddemus:use-build-and-inspect-python-package
Feb 13, 2023
Merged

nicoddemus merged 7 commits into
pytest-dev:mainfrom
nicoddemus:use-build-and-inspect-python-package

Conversation

@nicoddemus

@nicoddemus nicoddemus commented Feb 9, 2023 •

Copy link
Copy Markdown
Member

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.

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

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/[email protected]

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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)
imgbot Bot pushed a commit to kkipngenokoech/pytest that referenced this pull request Apr 18, 2026
imgbot Bot pushed a commit to kkipngenokoech/pytest that referenced this pull request Apr 18, 2026
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