-
Notifications
You must be signed in to change notification settings - Fork 39
fix: git URLs working with bootstrap-parallel #842
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
mergify
merged 1 commit into
python-wheel-build:main
from
iangelak:761-fix-bootstrap-parallel-git-urls
Dec 12, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Test bootstrapping from a requirement with a git+https URL witout specifying a | ||
| # version tag. | ||
|
|
||
| SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
| source "$SCRIPTDIR/common.sh" | ||
|
|
||
| GIT_REPO_URL="https://github.com/python-wheel-build/stevedore-test-repo.git" | ||
|
|
||
| fromager \ | ||
| --debug \ | ||
| --log-file="$OUTDIR/bootstrap.log" \ | ||
| --error-log-file="$OUTDIR/fromager-errors.log" \ | ||
| --sdists-repo="$OUTDIR/sdists-repo" \ | ||
| --wheels-repo="$OUTDIR/wheels-repo" \ | ||
| --work-dir="$OUTDIR/work-dir" \ | ||
| --settings-dir="$SCRIPTDIR/changelog_settings" \ | ||
| bootstrap-parallel "stevedore @ git+${GIT_REPO_URL}" | ||
|
|
||
| find "$OUTDIR/wheels-repo/" -name '*.whl' | ||
| find "$OUTDIR/sdists-repo/" -name '*.tar.gz' | ||
| ls "$OUTDIR"/work-dir/*/build.log || true | ||
|
|
||
| EXPECTED_FILES=" | ||
| $OUTDIR/wheels-repo/downloads/setuptools-*.whl | ||
| $OUTDIR/wheels-repo/downloads/pbr-*.whl | ||
| $OUTDIR/wheels-repo/downloads/stevedore-*.whl | ||
|
|
||
| $OUTDIR/sdists-repo/downloads/setuptools-*.tar.gz | ||
| $OUTDIR/sdists-repo/downloads/pbr-*.tar.gz | ||
|
|
||
| $OUTDIR/sdists-repo/builds/stevedore-*.tar.gz | ||
| $OUTDIR/sdists-repo/builds/setuptools-*.tar.gz | ||
| $OUTDIR/sdists-repo/builds/pbr-*.tar.gz | ||
|
|
||
| $OUTDIR/work-dir/build-order.json | ||
| $OUTDIR/work-dir/constraints.txt | ||
|
|
||
| $OUTDIR/bootstrap.log | ||
| $OUTDIR/fromager-errors.log | ||
|
|
||
| $OUTDIR/work-dir/pbr-*/build.log | ||
| $OUTDIR/work-dir/setuptools-*/build.log | ||
| $OUTDIR/work-dir/stevedore-*/build.log | ||
| " | ||
|
|
||
| pass=true | ||
| for pattern in $EXPECTED_FILES; do | ||
| if [ ! -f "${pattern}" ]; then | ||
| echo "Did not find $pattern" 1>&2 | ||
| pass=false | ||
| fi | ||
| done | ||
|
|
||
| $pass | ||
|
|
||
| twine check "$OUTDIR"/sdists-repo/builds/*.tar.gz | ||
| twine check "$OUTDIR"/wheels-repo/downloads/*.whl | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Test bootstrapping from a requirement with a git+https URL and specifying a | ||
| # version tag. | ||
|
|
||
| SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
| source "$SCRIPTDIR/common.sh" | ||
|
|
||
| GIT_REPO_URL="https://github.com/python-wheel-build/stevedore-test-repo.git" | ||
|
|
||
| fromager \ | ||
| --debug \ | ||
| --log-file="$OUTDIR/bootstrap.log" \ | ||
| --error-log-file="$OUTDIR/fromager-errors.log" \ | ||
| --sdists-repo="$OUTDIR/sdists-repo" \ | ||
| --wheels-repo="$OUTDIR/wheels-repo" \ | ||
| --work-dir="$OUTDIR/work-dir" \ | ||
| --settings-dir="$SCRIPTDIR/changelog_settings" \ | ||
| bootstrap-parallel "stevedore @ git+${GIT_REPO_URL}@5.2.0" | ||
|
|
||
| find "$OUTDIR/wheels-repo/" -name '*.whl' | ||
| find "$OUTDIR/sdists-repo/" -name '*.tar.gz' | ||
| ls "$OUTDIR"/work-dir/*/build.log || true | ||
|
|
||
| EXPECTED_FILES=" | ||
| $OUTDIR/wheels-repo/downloads/setuptools-*.whl | ||
| $OUTDIR/wheels-repo/downloads/pbr-*.whl | ||
| $OUTDIR/wheels-repo/downloads/stevedore-*.whl | ||
|
|
||
| $OUTDIR/sdists-repo/downloads/setuptools-*.tar.gz | ||
| $OUTDIR/sdists-repo/downloads/pbr-*.tar.gz | ||
|
|
||
| $OUTDIR/sdists-repo/builds/stevedore-*.tar.gz | ||
| $OUTDIR/sdists-repo/builds/setuptools-*.tar.gz | ||
| $OUTDIR/sdists-repo/builds/pbr-*.tar.gz | ||
|
|
||
| $OUTDIR/work-dir/build-order.json | ||
| $OUTDIR/work-dir/constraints.txt | ||
|
|
||
| $OUTDIR/bootstrap.log | ||
| $OUTDIR/fromager-errors.log | ||
|
|
||
| $OUTDIR/work-dir/pbr-*/build.log | ||
| $OUTDIR/work-dir/setuptools-*/build.log | ||
| $OUTDIR/work-dir/stevedore-*/build.log | ||
| " | ||
|
|
||
| pass=true | ||
| for pattern in $EXPECTED_FILES; do | ||
| if [ ! -f "${pattern}" ]; then | ||
| echo "Did not find $pattern" 1>&2 | ||
| pass=false | ||
| fi | ||
| done | ||
|
|
||
| $pass | ||
|
|
||
| twine check "$OUTDIR"/sdists-repo/builds/*.tar.gz | ||
| twine check "$OUTDIR"/wheels-repo/downloads/*.whl | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| import tarfile | ||
| import typing | ||
| import zipfile | ||
| from urllib.parse import urlparse | ||
|
|
||
| import resolvelib | ||
| from packaging.requirements import Requirement | ||
|
|
@@ -76,11 +77,32 @@ def download_source( | |
| elif req.url: | ||
| download_path = ctx.work_dir / f"{req.name}-{version}" / f"{req.name}-{version}" | ||
| download_path.mkdir(parents=True, exist_ok=True) | ||
|
|
||
| # Parse ref from URL if it's in the form repo@ref | ||
|
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. I might have put this logic in |
||
| url_to_clone = req.url | ||
| git_ref: str | None = None | ||
|
|
||
| # Remove git+ prefix for parsing | ||
| parsing_url = url_to_clone | ||
| if parsing_url.startswith("git+"): | ||
| parsing_url = parsing_url[len("git+") :] | ||
|
|
||
| parsed_url = urlparse(parsing_url) | ||
| if "@" in parsed_url.path: | ||
| # Extract the ref from the path (e.g., /path/to/repo.git@5.2.0 -> @5.2.0) | ||
| new_path, _, git_ref = parsed_url.path.rpartition("@") | ||
| # Reconstruct URL without the @ref part | ||
| url_to_clone = parsed_url._replace(path=new_path).geturl() | ||
| # Add back git+ prefix if it was present | ||
| if req.url.startswith("git+"): | ||
| url_to_clone = f"git+{url_to_clone}" | ||
|
|
||
LalatenduMohanty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| download_git_source( | ||
| ctx=ctx, | ||
| req=req, | ||
| url_to_clone=req.url, | ||
| url_to_clone=url_to_clone, | ||
| destination_dir=download_path, | ||
| ref=git_ref, | ||
| ) | ||
| return download_path | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think this syntax isn't right because there are spaces. It would at least need to be quoted to be processed properly, as was done in the test script. Please submit a follow up PR to fix that.