-
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
PEP 517 isolation breaks test module with relative out-of-source dependency #6276
Comments
I'll note that I seem to be able to partially fix this by setting Very hard to say what's going on there - possibly this is a problem with |
Pinging @pfmoore on this. |
This isn't related to PEP 517 as such. Rather, it's related to pip not using in-place builds. Which is something we've started doing with PEP 517, but we'd discussed on a number of occasions for legacy builds (and TBH, I thought we were doing it, but obviously not...) So I'm going to remove the "PEP 517 impact" label, as that's something of a red herring. In-place builds was something that was considered during the PEP 517 discussions, and deferred as way too complicated for us to reach any sort of agreement on. At the time, the focus was around incremental builds, for scientific packages that had significant C code build steps, where build times were helped a lot by reusing already built object files. So there's another group of people interested in this area. But I'm not honestly sure even what is being requested here. You seem to have a project with a dependency that somehow must be I think that a general solution here would require a new PEP to handle it - and given that it was "too hard" to include when we were discussing PEP 517, I think that whoever champions that PEP would need to be prepared for a pretty long and complex discussion... If we had an "awaiting a new PEP" label, I'd add that here - but I don't know if it's worth adding such a label just for this issue. Regardless, I don't think there's anything for pip to do before we get some sort of standard approach agreed. |
This is not a project that would be made into an
I'm fine with however you want to categorize it, since that's just about how this project tracks its issues, but I think it may be splitting hairs a bit to say that this is not a PEP 517 problem because it's not inherent to PEP 517. I think this is specifically about The current workarounds are using In the end I realize that we have at least been partially counting on something that wasn't necessarily guaranteed (the fact that the build happens in place), and the vast majority of people won't have this specific requirement, so I don't think it needs to be a high priority if it's addressed at all. I just wanted to file a ticket so that the project would be aware of the issue. |
If that's the case, then I'd personally say that it isn't something I'd expect to be managed with pip. I know there are some people that want pip to be the unified front end for any management of Python code, but that's not my view - I think that by expecting pip to cover everything, we end up with a tool that's too complex for its own good. (I'm a fan of the Unix philosophy of small, focused tools that do one job well). So maybe my opinions here aren't going to help much ;-)
OK. It's a debatable point. But I don't think it matters much.
Yes. Pip has never guaranteed that we'll build projects in place, but equally we've always (prior to PEP 517/518) been stalled changing that because of backward compatibility problems. We took the opportunity with PEP 517/518 to make the switch - not least because we were already having to switch to always installing via wheel (because PEP 517 has no "direct install" option) so it was good to do all the changes together. Longer term, the intention is to move to never even building wheels directly, but rather going It's certainly arguable that it's not as easy for projects to "opt out" of PEP 517/518 as we'd like - tools using
And thanks for doing so. I'm not objecting to the ticket at all, I just want to make sure that the explanation is clear, for people who find the ticket later. (PS I should say that the history of in-place builds within pip is long, and complex - we've tried to change things in the past, certainly. And my memory of what the behaviour was at any particular time may be wrong. So apologies in advance for any inaccuracies in the above. "These are purely my personal views and recollections" and all that ;-)) |
It may be getting a bit too much in the weeds on this specific example, but in this case I would prefer to use It is not a problem to create an intermediate sdist since we use We may be able to fix this by creating a custom |
This issue looks similar to #3500. |
Okay, this is blocked on #2195 -- building local directories, via sdist. |
This should be resolved by #7882 (build local directories in place). |
We have now (per #7951) published a beta release of pip, pip 20.1b1. This release includes #7882, which implemented a solution for this issue. I hope participants in this issue will help us by testing the beta and checking for new bugs. We'd like to identify and iron out any potential issues before the main 20.1 release on Tuesday. I also welcome positive feedback along the lines of "yay, it works better now!" as well, since the issue tracker is usually full of "issues". :) |
Thanks, can confirm that for pip 20.1 the problem reported originally in this ticket is resolved! 🚀 |
@davidhewitt Thanks for the verification on this - we appreciate you taking the time to report back 🙂 Unfortunately, there have been a number of issues with the implementation of in-place builds (which are being tracked under #7555) which means that for now, we need to revert this change. As a result this issue will become a problem again, and we'll therefore be reopening it. Longer-term, we hope to have a solution that addresses the issues that in-place builds solved, but without the impact on other workflows that the current solution had. Sorry for the disruption that this will cause. (@pradyunsg - can you please include this information in the other issues covered by the in-place build changes, as we discussed?) |
Now that #7555 has landed for good, I think this can be closed again. Holler if not. |
Environment
Description
In the PyO3 project, we have a test module nested inside the
examples
folder that needs to build against the version ofpyo3
in the repository, which is located in../..
relative to the source root, because it's intended to test that version of PyO3. This is accomplished by specifying the path of thepyo3
root inCargo.toml
.The problem is that when using PEP 517, the build root gets moved out of the source tree (fair), and we no longer have a reliable way to specify a relative out-of-source dependency.
Given that this is a pretty unusual requirement, I'm going to investigate various ways to work around this from within
setup.py
(maybe rewrite theCargo.toml
file with an absolute file path as part of ansdist
build or write a custom PEP 517 backend), but I thought I'd bring it up as a potential incompatibility with PEP 517.See PyO3/pyo3#362
The text was updated successfully, but these errors were encountered: