-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Allow to skip dependencies (--no-deps
) for individual requirements
#817
Comments
For me |
FTR,
|
Yeah, it should not end up there, but get consumed / used by pip-compile. |
The |
I've thought about pip-compile using this internally only. |
Looks like |
This comment has been minimized.
This comment has been minimized.
@atugushev pip-tools/piptools/repositories/pypi.py Line 221 in 0da08e5
(for all requirements that have a --no-deps option (similar to the existing -e option that can be specified with requirements.in entries))
|
Can we get a clearer picture of the feature requirement? Does the problem go beyond particular packages specifying hard deps instead of using extras groups? |
EDIT: This was wrong! OriginalI don't think this particular workaround (which I think achieves the desired behavior) has been articulated here yet:
-r reqs-with-deps.txt
req-without-dep1
req-without-dep2
req1
req2 $ pip-compile reqs-with-deps.in && pip-compile --pip-args --no-deps requirements.in |
--no-deps
)--no-deps
) for individual requirements
this seems to not work as expected for compilation. "deps without dependencies" are still resolved to full list of dependencies given in requrirements.in. I works only with My use case is that:
As --index-url are global options, my idea was to have a common, final lock file with hashes so that we can install with So thought about something similar to yours approach
pip-compile internal.in --generate-hashes --index-url=https://private --pip-args --no-deps
pip-compile external.in --generate-hashes (the first commad just to generate hashes of our pkges, then prepare all deps tree) Is there any other way/workaround to dump hashes of given list of requrieemtns WITHOUT resolving all their dependencies? Before "hashes approach" I was using |
You're right, I'm sorry! I don't work much with private indexes, so forgive my ignorance here, but why do you need to avoid resolving the dependencies? Why not compile them all, passing I'll mention that nowadays $ wheezy.template =(<<<'@require(version, wheels)
requests==@version\
@for wheel in wheels:
--hash=@wheel["hash"]
@end') =(toml2nt uv.lock | nt2json | yaml-get -p 'package.[name=requests]') yielding: requests==2.32.3 --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 |
It would be useful if you could specify
--no-deps
for some dependencies, where you do not want pip-compile to include the dependencies, but control it manually.pip's own options are handled via https://github.com/pypa/pip/blob/f8732ac06dcb7c6af81dcdc0cc3158196b796baf/src/pip/_internal/req/req_file.py#L283 (e.g.
--hash
).This might also make sense as a global option to
pip-compile
, but usually is more important for single deps only (i.e. in a line in therequirements.in
file).The text was updated successfully, but these errors were encountered: