-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
PEP 517 - can't build a dependency without setup.py #6181
Comments
Seems like #6170. Asking the same questions here:
|
Here is a sample that allows recreating this:
|
You haven't specified the build backend in |
Thanks @pfmoore this is defiantly progress, and missout on my end, I was actually thinking the ability to install packages from pyproject.toml is being supported, but I guess what is supported is the ability to hand over the build system to another tool, or something. Based on that, I have now added:
This now fails with:
Specifically - No matching distribution found for odata Even though, when running poetry install on the tafrget lib it works just fine and installs:
E.g. something in the handoff to poetry does not work as expected, note that this specific lib is installed from git and not fro pypi: https://github.com/AvnerCohen/pytoml_sample/blob/master/pyproject.toml#L25 |
I'd look at what the poetry PEP 517 backend is doing. You may need to somehow enable debug output from that backend, but how you'd do that is backend-specific. |
Persumably if you try to install |
I think, this is effectively a poetry bug I think. Looking at the
When I slightly tweak my local copy of pip to spew out the exact information that the poetry build backend returned for what the requirements are, I see:
Since odata does not exist on PyPI, and poetry is omitting information about where to locate odata, we are not able to install odata to setup the build environment. When I tell pip where to find odata at, it works (well it still fails, but it fails because of a poetry issue with your Try using:
There's nothing actionable here for pip, poetry needs to correctly handle git dependencies. |
@dstufft I could still be missing something, but I think this is too hasty to close this. Installing the dependency directly from poetry, as I wrote above works just fine:
You can also see the poetry lock file that is created as expected and clearly pointing to the git repo: |
The poetry backend has to tell pip the requirement (in a form that pip can use). Pip uses that to set up the build environment. That's what Note - this is likely the first time the poetry backend has ever seen real-world use, so it's to be expected that it would have teething troubles. |
Yes, it works from poetry because poetry is directly reading the If you notice, that is a section that is entirely poetry specific and pip has no knowledge of it. When pip attempts to build the wheel, it invokes the poetry build backend API and asks it "hey, what dependencies do you need to build a wheel so I can install them for it". The intent here is that poetry (or any build backend) will use their tool specific mechanism for locating those dependencies, and report them back to pip so pip can install them. Unfortunately, when pip asks poetry for the build dependencies, it returns just "odata" without any additional information on where to locate that dependency from. Since we don't have any additional information, we end up searching the configured repositories for it, which defaults to PyPI (and the command I linked adds another location, the git URL). When pip can't find the dependency in it's configured locations, it appropriately fails. As an aside, It seems odd to me that poetry is returning the runtime dependencies when we ask it what the build dependencies are, but that may just be a design decision that poetry made. |
This is great stuff guys, I appreciate the help and detailed responses. I'll head over there to try and get it resolved, I guess a better python world is when everything will play nicely together. Thanks! EDITED: |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Environment
Description
Deploying a dependency that does not have setup.py, but does have pyproject.toml, fails with "setup.py" not found
Expected behavior
Build is expected to complete succesfully.
How to Reproduce
pip install anypackage.with.toml.and.no.setup.py
Output
The text was updated successfully, but these errors were encountered: