Skip to content
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

Raise an error on invalid egg fragments #13157

Open
ichard26 opened this issue Jan 12, 2025 · 2 comments
Open

Raise an error on invalid egg fragments #13157

ichard26 opened this issue Jan 12, 2025 · 2 comments
Labels
type: deprecation Related to deprecation / removal.
Milestone

Comments

@ichard26
Copy link
Member

We deprecated anything that isn't a bare project name in an egg fragment in #11567. It's scheduled for removal in pip 25.0. Let's make this an error.

def _egg_fragment(self) -> Optional[str]:
match = self._egg_fragment_re.search(self._url)
if not match:
return None
# An egg fragment looks like a PEP 508 project name, along with
# an optional extras specifier. Anything else is invalid.
project_name = match.group(1)
if not self._project_name_re.match(project_name):
deprecated(
reason=f"{self} contains an egg fragment with a non-PEP 508 name",
replacement="to use the req @ url syntax, and remove the egg fragment",
gone_in="25.0",
issue=11617,
)
return project_name

cc @woodruffw

@ichard26 ichard26 added the type: deprecation Related to deprecation / removal. label Jan 12, 2025
@ichard26 ichard26 added this to the 25.0 milestone Jan 12, 2025
@ichard26
Copy link
Member Author

ichard26 commented Jan 12, 2025

Hmm, editable VCS installs don't support the direct URL syntax. This means the egg fragment is the only supported way to request an extra for VCS URLs. We'd need to revive #9471 before raising an error.

It's probably best to punt this to a later release.

@notatallshaw
Copy link
Member

I think uv already supports the syntax "mypackage[extra] @ {VCS_URL}", but I've never looked at how feasible this is in pip or if it's been tried before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: deprecation Related to deprecation / removal.
Projects
None yet
Development

No branches or pull requests

2 participants