Skip to content

Dependency defined in setup.py install_requires incompatible with requirements of other dependency also defined in install_requires #2217

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

Closed
ValentinMoullet opened this issue Jun 25, 2020 · 2 comments

Comments

@ValentinMoullet
Copy link

Hi,

Let me start by saying that I'm not sure this is a bug, but this is most likely something I misunderstand about setuptools. I searched about it in the docs but couldn't find an answer to this.

I have a simple setup.py file containing my dependencies in install_requires. Let's say my package has 2 different dependencies: A and B. This means that, in my package, I use some code from A and I use some code from B. I don't put any specific versions for those 2 requirements inside install_requires, I only put their name. Now, let's say B actually also depends on A but up to a certain version, so in their own setup.py and ìnstall_requires, they will have something like: A<2.24.0. This works fine as long as A actually has no such version or above, but as soon as A releases the version 2.24.0 (and B doesn't/cannot update its setup.py`), then when installing our package using pip, we will use a version that is not allowed by B (thus B is broken). When installing with pip, we will actually see a warning like this one:

B has requirement A<2.24.0, but you'll have A 2.24.0 which is incompatible.

I was wondering if this was normal that setuptools wouldn't find the highest version of A allowed by the other dependencies (i.e. B), instead of directly installing the latest version of A? If yes, then what is the standard way of preventing this kind of problem?

Thanks in advance for the help, this would be very appreciated.

@McSinyx
Copy link
Contributor

McSinyx commented Jun 25, 2020

I think this has more to do with the way pip handle dependencies, so filling an issue over pip might be a better idea.

@ValentinMoullet
Copy link
Author

Thank you for your answer. I went into the issues of pip repo and found questions/comments related to my observation here. From what I understood, this is the expected behavior of the current resolver, but there are discussions around it. See this thread which helped me understand this: pypa/pip#8339.

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

No branches or pull requests

2 participants