-
Notifications
You must be signed in to change notification settings - Fork 140
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
Why does get_requires_for_build_wheel return the runtime requirements? #354
Comments
I agree that One thing that flit does, however, is attempt to import the package to retrieve the That being said, it's probably more correct to not include runtime dependencies as build dependencies and accept that the version discovery fallback is more likely to fail. Truthfully, there likely needs to be another PEP for specifying package versions outside of the source python package to really solve this problem for good. |
So, in my specific case, could the problem be that, by the time flit is generating requirements for the isolated environment, it doesn't have visibility into the constraints files passed to pip? (At least, I think it doesn't. It might.) To go into a little more detail, I've got a repository with multiple (currently two) flit projects. Project 2 depends on Project 1. I can install Project 1 via Thinking about this further, I could avoid this problem by building everything before running tests, and storing the wheels in a local index. That'd be faster and cleaner. |
AFAIK, flit isn't actually responsible for resolving the requirements, it just passes the requested dependency strings straight from the metadata. |
Since I understand why this is done now, I've concluded it would make more sense to discuss this on the pip repo, and opened the above issue over there. |
I'm attempting a somewhat elaborate repository layout, in which some dependencies are only available locally via constraints files, and it's failing because pip is attempting to install the runtime dependencies in an isolated environment, without reference to the constraint files.
It looks like this is down to the implementation of
get_requires_for_build_wheel
, which in the other PEP 517 build systems I've looked at (Poetry and Enscons) just returns an empty list. In flit, it returns the contents oftools.flit.metadata.requires
, which I understand to be the runtime requirements, and I don't think I need them to build the packages. Without the ability to install something, pip fails after logging "Installing backend dependencies". (The "something" doesn't have to be remotely what's intended. My initial testing was confounded because I was specifying a local package that shared a name with an unrelated package in pypi. So, the pypi package got installed in the isolated environment, and the local package got installed in the virtualenv where pip was.)I worked around this by disabling build isolation and explicitly installing flit in the target environment, but I'd like to better understand the intents and tradeoffs here.
The text was updated successfully, but these errors were encountered: