-
-
Notifications
You must be signed in to change notification settings - Fork 397
use constraints file for sdist/wheel build + get version using build.util #3167
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,14 +40,19 @@ jobs: | |||||||||
| with: | ||||||||||
| persist-credentials: false | ||||||||||
|
|
||||||||||
| - name: Install build | ||||||||||
| run: python -Im pip install build -c test-requirements.txt | ||||||||||
|
|
||||||||||
| - name: Get the dist version | ||||||||||
| id: dist-version | ||||||||||
| run: >- | ||||||||||
| echo "version=$( | ||||||||||
| grep ^__version__ src/trio/_version.py | ||||||||||
| | sed 's#__version__ = "\([^"]\+\)"#\1#' | ||||||||||
| )" | ||||||||||
| >> "${GITHUB_OUTPUT}" | ||||||||||
| shell: python | ||||||||||
| run: | | ||||||||||
| import os | ||||||||||
| import build.util | ||||||||||
| version = build.util.project_wheel_metadata(".")["version"] | ||||||||||
|
|
||||||||||
| with open(os.environ["GITHUB_OUTPUT"], mode="a", encoding="utf8") as f: | ||||||||||
| f.write(f"version={version}") | ||||||||||
|
|
||||||||||
| - name: Set the expected dist artifact names | ||||||||||
| id: artifact-name | ||||||||||
|
|
@@ -58,9 +63,6 @@ jobs: | |||||||||
| DIST_NAME: ${{ env.dist-name }} | ||||||||||
| VERSION: ${{ steps.dist-version.outputs.version }} | ||||||||||
|
|
||||||||||
| - name: Install build | ||||||||||
| run: python -Im pip install build | ||||||||||
|
|
||||||||||
| - name: Build dists | ||||||||||
| run: python -Im build | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming, you'll do something like
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suddenly remembered this PR when looking at the release notes for pip 26.1! I think this would need to be (I thought we had merged this though xd)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Certainly! |
||||||||||
| - name: Verify that the artifacts with expected names got created | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,7 +41,7 @@ python -m pip install -U pip uv -c test-requirements.txt | |||||
| python -m pip --version | ||||||
| python -m uv --version | ||||||
|
|
||||||
| python -m uv pip install build | ||||||
| python -m uv pip install build -c test-requirements.txt | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could also use an env var:
Suggested change
|
||||||
|
|
||||||
| python -m build | ||||||
| wheel_package=$(ls dist/*.whl) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would leak into the underlying PEP 517 ephemeral build envs.