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

Never ignore URL dependencies in PEP 723 noxfiles #935

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gschaffner
Copy link
Contributor

Fixes #934.

W.r.t. performance: On uv (the default, if available), uv caches based on the URL. On virtualenv however, the URL will get pulled and built/installed every time.

Ideally, for the virtualenv case, nox would do its own caching on the URL, similar to what the uv backend, uv run -s noxfile.py and pipx run noxfile.py all do. I have not included that here since I wanted to keep the scope of this PR to the correctness issue. Caching can be added later if needed. URL dependencies in PEP 723 noxfiles are perhaps not a very common case anyway, so perhaps it is TBD whether it's worth it for Nox to build a serialization format for doing said caching?

@gschaffner gschaffner force-pushed the fix-url-dep-pep-723-noxfile branch from c552774 to 4a3878f Compare February 14, 2025 07:34
@gschaffner
Copy link
Contributor Author

Actually, perhaps we should be parsing PEP 610 metadata here?

@gschaffner
Copy link
Contributor Author

I checked to see if we could just use build.check_dependency for check_dependencies, but it has a similar issue: pypa/build#860

@@ -106,6 +106,8 @@ def check_dependencies(dependencies: list[str]) -> bool:
version = importlib.metadata.version(dep.name)
if not dep.specifier.contains(version):
return False
if dep.url:
return False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could make this smarter, given the suggestion in build and importlib.metadata's .origin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

URL dependencies are sometimes silently ignored in PEP 723 noxfiles
2 participants