-
Notifications
You must be signed in to change notification settings - Fork 189
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
Urgent: add option to disable numpy install / prevent corruption of conda-forge environments #1040
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #1040 +/- ##
==========================================
+ Coverage 67.03% 67.22% +0.19%
==========================================
Files 20 20
Lines 2017 2017
==========================================
+ Hits 1352 1356 +4
+ Misses 665 661 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I'm not sure I'm following. All PyCall.jl wants to do is ensure that the conda environment it is operating in has |
Could we consider adding |
Wait, I thought this line was the cause of the downstream issues? Doesn’t |
https://docs.conda.io/projects/conda/en/latest/commands/install.html
(maybe that’s what you meant by |
I think it’s safer to entirely turn off calls to |
Actually, I think we want |
It should throw errors since you did not previously add all the needed dependencies. |
Okay I added the required functionality in JuliaPy/Conda.jl#240 |
If this is possible, it is desirable. However, it likely should be done as a patch in conda-forge, not here. I will leave that up to you though. Why would PyCall need numpy to begin with? That’s kinda odd and arbitrary (isn’t it supposed to be a generic python caller?) |
In order to wrap Julia arrays with numpy arrays when calling Python. |
2 similar comments
In order to wrap Julia arrays with numpy arrays when calling Python. |
In order to wrap Julia arrays with numpy arrays when calling Python. |
@mkitti Updated with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The revised build does not try to upgrade numpy if it is in the configured conda environment.
@stevengj could we merge and release this change? |
Just pinging this - could this be merged @stevengj? |
It says:
so we can't even test it. Also, pyjulia already dropped support. |
@stevengj sorry for the spam but we really need this fixed to solve some downstream failures. Any chance you could merge+release? |
@MilesCranmer, is pycall available in conda-forge somehow? What in conda-forge uses it? If that's the case, we could patch it and move the ball forward instead of waiting. |
Or is it the thing that Julia calls and we bundle in your pysr setup? |
If so, we could point your pysr package on Conda-forge to use this https://github.com/MilesCranmer/PyCall.jl/tree/patch-numpy-install (I don't know how that's done in Julia, but I assume it is easily doable, right?) |
Right, we bundle it with the PySR install as a special julia depot. |
Right now PyCall.jl automatically installs numpy into a conda environment. This install cannot be disabled. If this occurs from within an existing conda environment, it can overwrite the numpy installed by a conda-forge build. This violates the assumptions of conda-forge, and can silently corrupt any conda env that depends on numpy.
This issue was noticed in conda-forge/pysr-feedstock#85, manifesting in this issue: conda-forge/scipy-feedstock#238. We believe this is caused by the line:
PyCall.jl/deps/build.jl
Line 79 in bcaba00
This PR enables the
PYCALL_INSTALL_NUMPY
environment flag which can be set tofalse
to disable theConda.add("numpy")
line and prevent the corruption of a conda env. The default behavior is unchanged if this flag is not set, so this is backwards compatible.cc @h-vetinari @mkitti @ngam