-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Comply with PEP 518. #7309
Comply with PEP 518. #7309
Conversation
Thanks @xoviat, good idea. Will look at this in detail soon. |
This PR looks pretty straightforward, but I don't think we should merge it before support for PEP 518 is merged in pip (any day now, pypa/pip#4144) and we can test that things work as expected. |
The PEP doesn't say anything about optional build dependencies (like Cython for building from a git repo), so I guess we'll just have to leave that out. |
It's merged now. Not in the latest |
Note that this can't be tested from a git checkout, because |
Testing via |
Testing this turned up a fairly serious problem with PEP 518 (or maybe I'm misunderstanding something). The intention of the PEP is "Installation of the build system". This is further clarified like so:
For So Doing Even if we avoid @njsmith @takluyver opinions? |
Can it say `numpy>=1.lowest.supported`? Is the package installed also
then even if it is installed in the system?
|
Apparently not, it seems to call `pip install --ignore-installed ...`.
Because the build itself is not be isolated from the environment in
other respects, I'm not sure if this is actually sensible behavior by pip...
|
My expectation is that you want to use |
Why does it disallow building against numpy already installed on the system?
|
In terms of the spec, it does not prevent that. But the implementation in pip will always install these requirements anew to do the build. Might be worth bringing up on distutils-sig. |
So in the end it looks like this should read "numpy >= 1.8.2", and then
wrangle with pip authors to fix the arguably suboptimal behavior.
|
This is not in line with the specification, but simply a pip implementation detail. If this is really a problem, then file a pip bug. |
That can't work reliably. Suppose that library A depends on numpy == 1.10.0 and on scipy, and someone does Plus in general build-requirements can't be installed into the system environment for a number of reasons, and you'd really rather that builds use a clean environment for reproducibility and to reduce the number of cases that need testing, so using the system numpy is really not trivial. (IIRC @takluyver had to drop the feature of running builds in a real fresh environment for now due to some annoying technical problem, but I would hope pip adds it back in the future.) Again, why do you consider pip's behavior suboptimal? |
But this is not the case that we are discussing. This is about the situation where numpy is already installed in the virtualenv. Moreover, also in the case that you describe, won't the current behavior of pip already produce broken environment? Is there any guarantee the numpy installed in the temporary environment is older release than what finally ends up being installed in the environment --- which is necessary to guarantee ABI compatibility? |
The reasons why I believe pip's current behavior is suboptimal are explained in the pip issue above. |
Ok, but if your proposal to handle the case we're discussing will as a side effect break a case that we're not discussing, perhaps we should discuss both of them together :-)
That's why scipy should declare a build dependency on the oldest supported numpy. That's what gives you the guarantee that the resulting scipy binary will work in any environment it might be installed into. |
Ok, so by "my proposal" you meant the |
No, because even if pip is modified to use system packages when possible, this will only happen if the system packages satisfy the declared version constraints. So you really want pip to use system packages if possible, AND some constraint that means "I'll accept any of these versions of they're already installed, but if none of them is installed give me the oldest". That's not what In any case, even if you extended pip's constraint language to support that, I gave an example of where it would still produce broken installs in a comment on the pip bug... |
Yes, so the question is about |
It's distutils, my technically correct description can't be clear almost by definition:) Let's try in a handwaving way:
|
The site.cfg stuff doesn't really work with pip. You can achieve it with
`setup.py bdist_wheel` and then installing the built wheels.
|
Why not? |
This is gradually becoming less accurate: in an increasing number of situations, pip will call |
You're completely right. I was sloppy with the details; it doesn't make any difference though. As long as a normal build is done which invokes |
The right version of this should be:
@xoviat can you update your PR? We're going to just have to ignore the |
@rgommers Done. It's better to get this stuff hashed out sooner rather than later. |
Merged, thanks @xoviat, all! |
Forgive the uninformed question, but I'm trying to add a pyproject.toml for pandas, and was basing it off Scipy's. I've cloned scipy, and setup a clean virtual environment with
pip and setuptools are master as of today. I run
Does that seem like a bug in setuptools / pip, or is it a problem with scipy's pyproject.toml? (Or, more likely, am I doing something wrong?) |
I think |
FYI PEP 518 is not implemented in pip. |
Yeah, and I'm using pip master. Quoting |
No. pip does not implement 518. They tried to implement it and failed. I'm
working on a fix.
On Aug 24, 2017 8:21 AM, "Tom Augspurger" <notifications@github.com> wrote:
Yeah, and I'm using pip master. Quoting 3.4 lead to a different error. I'll
keep debugging this and report back (hopefully with a PR).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7309 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AOo8_Dpaf0rBitQVAuVJy1WgJIjb2Hlvks5sbXjtgaJpZM4M_Mlm>
.
|
But I guess we should add the double quotes (or single quotes) in the environment markers, as they seem to be required by PEP 508: gh-7792 |
Also, should we add cython? |
Yep. |
No description provided.