Skip to content

Treat paths originating as PEP 508 URLs which contain expanded variables as relative#18680

Merged
EliteTK merged 3 commits intomainfrom
tk/fix-relative-regression
Mar 23, 2026
Merged

Treat paths originating as PEP 508 URLs which contain expanded variables as relative#18680
EliteTK merged 3 commits intomainfrom
tk/fix-relative-regression

Conversation

@EliteTK
Copy link
Copy Markdown
Contributor

@EliteTK EliteTK commented Mar 23, 2026

Summary

Fix a regression caused by and reported in #18176.

PEP 508 doesn't actually permit variables to be specified within these URLs but we support this probably due to needing to handle it for requirements files.

To avoid a breaking change in a patch release, any VerbatimUrl that was parsed as a PEP 508 URL that contained variables that were expanded is always treated as relative.

The determination of if a VerbatimUrl qualifies has to be done at creation time because otherwise we would incorrectly treat a non PEP 508 URL which contained something which looks like a variable reference as a relative path in cases where this wouldn't be correct.

Test Plan

Existing test coverage covers the non-regressed case, added a test for the regressed case.

@EliteTK EliteTK added the bug Something isn't working label Mar 23, 2026
@EliteTK EliteTK force-pushed the tk/fix-relative-regression branch from 8fed99c to bffcf23 Compare March 23, 2026 19:19
@EliteTK EliteTK merged commit 8a712b0 into main Mar 23, 2026
54 checks passed
@EliteTK EliteTK deleted the tk/fix-relative-regression branch March 23, 2026 19:28
konstin pushed a commit that referenced this pull request Mar 24, 2026
…les as relative (#18680)

## Summary

Fix a regression caused by and reported in #18176.

PEP 508 doesn't actually permit variables to be specified within these
URLs but we support this probably due to needing to handle it for
requirements files.

To avoid a breaking change in a patch release, any `VerbatimUrl` that
was parsed as a PEP 508 URL that contained variables that were expanded
is always treated as relative.

The determination of if a `VerbatimUrl` qualifies has to be done at
creation time because otherwise we would incorrectly treat a non PEP 508
URL which contained something which looks like a variable reference as a
relative path in cases where this wouldn't be correct.

## Test Plan

Existing test coverage covers the non-regressed case, added a test for
the regressed case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants