-
Notifications
You must be signed in to change notification settings - Fork 2.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
Immitate pip install --no-deps
/ Add --only-root
#3377
Comments
To make sure I understand, you have tried the following and it does not fit your workflow, right?
|
Well, this is a nice hack, but it would require one of manipulating pyproject.toml every time I start developing on such a situation, or forcing relative paths on every developer in the project (given that the library is, or might be, in a different Git repository/whatever). |
I'd like to add a +1 here; sometimes upstream packages are too conservative when pinning dependencies. I'd rather avoid having to add a |
Does anyone found a way to prevent install sub-dependencies? It would also be interesting when trying to generate documentation for another package (where you only want to be able to read the package's code). My current fix is to put all the concerned package in my dev-dependencies, then run poetry with In my CI job, that looks like: poetry install --no-dev -vv
git submodule sync --recursive
git submodule update --init --recursive
poetry run python -m pip install --no-deps submodules/* |
Just adding another +1 for a different use case: multi-stage installations for quicker docker builds. Basically, the logic is, at my dayjob we build a new docker image for every code change, which means docker build time can be pretty important. Our application code changes a lot more frequently than our dependencies, so we split the install into two different phases: first, the dependencies, and then, the root project. That way, when all we have is changes in the application code, the docker image builder doesn't need to reinstall dependencies on every build. Hopefully that explanation makes sense (if you're familiar with docker anyways). The relevant bit of our dockerfile currently looks like this (side note: I personally would rather be distributing the application package as a first-class python package hosted on a private package index, but that's a completely separate conversation that has nothing to do with poetry!):
What I'd love to see instead, is something like this:
Edit: I'm stupid busy right now, so I can't put together a PR, but if in a month or two I have some free time and nobody else has closed this, would the maintainers be open to a PR? |
I'm interested into this! Use case: installing locally for development a package that requires a main dependency which isn't available anymore given the upgraded Python interpreter version for this local case only. Therefore I'm manually installing another version of the dependency, one that is available but can't continue on |
@Badg 100% agree with this use case. I noticed the same issue in our setup, where we have a tons of heavy ML libraries, which we'd like to avoid downloading each time. |
+1 |
Poetry on master should make this possible, albeit, via misfeature. poetry install --only=non-existent-group |
Yet Another Use Case: Since poetry does not recognize |
I'm also interested in this functionality. Our usecase... pytorch-toolbelt depends on any opencv package and have specified |
Is this possible now? Couldn't figure it out from perusing the docs. We hit the problem:
Currently we solve this by having a two-step process (in proj. A):
It would be nice to find a packaging system that can add the |
@cristianmtr There is now |
But this is only for the installation of the main project (project A) itself, not for the installation of dependencies (project B). How can I add a dependency in my |
As @Maciej-Zwolinski has said, this poses difficulties for when certain libraries have unusual package suffixes. For example, the official NVIDIA PyTorch image (
This makes poetry a bit frustrating to use in some edge cases, because poetry doesn't detect them as "valid" |
It seems for such cases, an override mechanism for recursive dependencies would be more appropriate.
|
I would recommend opening a separate issue for this problem |
If it is for dependencies, then yes it needs a different GitHub issue, yes.
I started a discussion on this here (not limited to Poetry): https://discuss.python.org/t/proposal-overrides-for-installers/23666 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
It would be great if Poetry could support installing only the root of the project, but leave all dependencies untouched, much like the
--no-deps
option to pip does.The use case is a development environment where the code being worked on is spread across several packages, and I want to keep several of them editable in the same poetry environment without having to temporarily change/remove a dependency from
pyproject.toml
.Poetry ould optionally still check whether the installed packages fulfill the dependencies or not, but with such an option that developers will explicitly use, this is not necessary I suppose.
The text was updated successfully, but these errors were encountered: