-
Notifications
You must be signed in to change notification settings - Fork 3k
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
--no-deps flag inside requirements.txt #9948
Comments
Sounds like a reasonable feature request to me. Hopefully someone is interested in implementing this. |
@uranusjr and @sergei3000, how do you see this feature being enabled?
|
Hi @rahul-kumi |
This is not possible because The possible solution I envision would be
|
Hi guys, kindly ask when will this feature be available? |
It would be avaiable if there is contribution. Feel free to work on a pull request. |
Is not #10837 an appropriate implementation? |
I'm curious -- everyone who is asking for this feature to be implemented ASAP, what is your usecase? |
CI where the deps are installed via other means. |
For outdated or conflicting dependency versions. |
That says to me “to deliberately install a set of dependencies which don’t satisfy the metadata”. That’s not something pip supports (and never was, not even when the bugs in the old resolver meant we couldn’t enforce this). |
There are definitely use cases for this |
(Thanks @Franky1, @Batev and @adam-urbanczyk for the quick responses) Ok, so all the use cases stated until now are basically a subset of #8076 -- that this is a somewhat stop-gap/pip-specific solution for IIUC. If that sounds about right, please 👍🏽 on this comment. If not, please drop a comment describing your usecase! I wanna make sure pip maintainers understand what usecases people, who are pushing for us to add this, have. :) |
I disagree. The use case I'm referring to is when you don't want to attract the original dependencies of a single package, but want to install those dependencies yourself because there are non-resolvable conflicts with those dependencies or there are non-installable dependencies in certain environments. |
So you want to install |
Yes.
Yes that would be the ideal solution. But if the maintainers don't offer this |
Cool. So it's #8076. Thanks for clarifying. Edit: I also note that there's google-ai-edge/mediapipe#3661 (which you are aware of, but I'm adding here for completeness), so like many of the use cases for #8076 it's needed as a temporary fix until the package authors address the problem. (Technically, an alternative fix as you can always do something like |
Another example usecase: I am in a situation where users need a library that depends on kerberos tools (gssapi, krb5, etc) because that is one authentication method, but there are other auth methods that do no use kerberos. It runs just fine without it locally. However, we want to install it within an app on a k8s pod that does not currently let us install the external kerberos tools (we want to use the other auth methods instead). Currently I cannot do this as the wheel build in the app tries to install all dependencies of libraries included in requirements.txt and errors out on the kerberos stuff. Maintainers are backlogged and not prioritizing switching deps to extra and I need this thing working ASAP. |
I've been looking for this for a slightly different use case to most other people. we have an AWS lambda that we need to migrate to the |
using workaround that would be better with pypa/pip#9948 or pypa/pip#10837
My own use case:
Note that |
My use case seems slightly different. Project A that I want to install depends on project B that has become uninstallable, for instance due to setuptools drift, and the original author is unresponsive. Project B has been forked by its community as B-forked, which is installable with modern tooling, but Project A is also unresponsive. So I'd like to add project A, along with its healthy sub-dependencies and project B-forked in my Arguably the most famous case of package fork renaming was PIL/Pillow, but for a concrete example, the FuelSDK package depends on (Yes, the project has come full circle, with the fork of the fork officially taking over the original name). So I'd like to ignore I can do a series of manual pip invocations that put my environment in the desired configuration, but I'd rather have a single
|
For those looking to implement this, a quick look at the code tells me that it might be possible to implement this by passing a set of project names as a There, in the def get_dependencies(self, candidate: Candidate) -> Sequence[Requirement]:
with_requires = (
not self._ignore_dependencies
and candidate.project_name not in self._ignore_dependencies_for
)
return [r for r in candidate.iter_dependencies(with_requires) if r is not None] Making sure that the names in the |
Please take a look at PR #12790 if you think this is a worthwhile implementation. |
I now also added support for the global |
@uranusjr, now that there is a PR, should the |
@leorochael IMO there's no rush. The PR is linked from here, so people will find it. I've posted a few questions over on the PR which might push this back to "needs discussion" but I'd rather get the comments addressed before worrying about labels. |
The pr was already here upd: your pr adds only a global cli arg to ignore deps, but you can do the same now using --no-deps wit -r (where only one dependency is provided) |
What's the problem this feature will solve?
I try to run
pip install -r requirements.txt
but I'd like one of the packages to be installed without dependencies.Describe the solution you'd like
Make --no-deps flag work inside
requirements.txt
I use AWS Elastic Beanstalk's Python platform. It installs all the packages from
requirements.txt
during deployment of user's code. One of the packages I use isaiopg
and I don't want it to installpsycopg2-binary
since it is not recommended for use in production. I have the originalpsycopg2
package inrequirements.txt
along with anotheraiopg
's dependencyasync-timeout
and that should be enough foraiopg
to work smoothly.Alternative Solutions
I can't find any workaround for this problem.
Additional context
The text was updated successfully, but these errors were encountered: