Repository navigation
MAINT: delay numpy import during build - #3195
matthew-brett wants to merge 5 commits into
Conversation
|
@josef-pkt Aside from needing a rebase, this seems ready. |
a3b5282 to
b5b8ac5
Compare
Delay numpy import until we build the extensions. This allows commands like ``egg_info`` to collect dependencies without crashing out with a missing numpy. Therefore, pip should be able to install numpy during the build process.
Also - import function from os.path.
|
I thought it failed in several travis version where statespace cython code didn't find anymore some numpy math functions. But I don't see the travis links here anymore. |
b5b8ac5 to
3081b07
Compare
|
python 3.6 failure is unrelated |
|
Yes, I don't understand the logic for this code in |
|
@ChadFulton knows the details and I never looked at them. The general problem is that we are doing currently compilation conditional on the scipy version. Some parts of the code take advantage of more recent access to the underlying linear algebra libraries in scipy. But we still support the older scipy versions that don't have these enhancements. |
Exactly. But I'm sure that the setup.py could be designed better, I just don't know how :) |
|
An alternative would be to move min SciPy to 0.16. Then there is no more conditional compilation. |
|
Updating the dependency to 0.16 would remove quite a lot of complexity here. For example, I noticed that, if you compile statsmodels with scipy < 0.16, and later install scipy >= 0.16, statsmodels crashes, because it thinks that the extra modules are compiled and tries to import them: |
Use correct name for _statespace module, when labeling it as needing the npymath includes / libraries.
129e5f7 to
134e261
Compare
|
An ImportError is not a crash, it's just an exception. When Chad started to work on this refactoring, scipy 0.16 was still very recent. I don't know if we can drop scipy < 0.16 for a statsmodels 0.9 release. (Personally, I still don't feel completely friendly towards pip, even though it is now my default installer. It wasn't friendly to us for many years.) |
9b57774 to
3dd29c6
Compare
|
Sure, I was using "crash" in the loose sense of dumping out with an exception, and no helpful error message. My impression is that this stuff will work OK when compiled on a later scipy, then used with an earlier scipy, is that right? |
That's a good point. I'll make a PR to check that the modules are actually built before using trying to use them, even if scipy >= 0.16 is installed. |
3dd29c6 to
50c62b7
Compare
|
@matthew-brett @bashtage As Kevin mentioned this should solve the main problems, and I like to follow scipy's lead in this kind of things. So can we just add a pyproject.toml file, and assume that it is enough for the relevant use cases? |
|
(and reading through scipy #7309 reminds me why I'd rather focus on statistics and econometrics) |
|
Josef - I think that PEP isn't even agreed yet - and when it is, I suppose it will take some time for it to filter through into the build tools, so no, I don't think that's an immediate solution. Yes, I think this one is mergeable after a rebase. |
|
Oops - sorry - yes the PEP's agreed - but I stand by the comment about build tools. |
|
The related PEP 517 is still being hashed out.
Agreed. This PR would still be useful. |
|
Had a look at this, summary:
Also +1 for scipy >= 0.16.1, which is 2 years old by now. |
|
ping
|
Add pyproject.toml to simplify installation into empty environments xref statsmodels#3195
Add pyproject.toml to simplify installation into empty environments xref statsmodels#3195
Re-enable xdist Small adjustment for windows testing closes statsmodels#4635 closes statsmodels#4638 closes statsmodels#4651 closes statsmodels#4654 closes statsmodels#3207 closes statsmodels#3195 closes statsmodels#3977
Re-enable xdist Small adjustment for windows testing closes statsmodels#4635 closes statsmodels#4638 closes statsmodels#4651 closes statsmodels#4654 closes statsmodels#3207 closes statsmodels#3195 closes statsmodels#3977
Re-enable xdist Small adjustment for windows testing closes statsmodels#4635 closes statsmodels#4638 closes statsmodels#4651 closes statsmodels#4654 closes statsmodels#3207 closes statsmodels#3195 closes statsmodels#3977
That commit was unrelated, this is not fixed. |
|
I think I put the wrong issues in the big CI PR. This should be closed by
the pending setup PR.
…On Mon, Aug 27, 2018, 15:59 Ralf Gommers ***@***.***> wrote:
Reopened #3195 <#3195>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3195 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFU5RU5xFwKPaHGAJGvvA1eUnz2CKCToks5uVAlZgaJpZM4J54ig>
.
|
|
Can be closed now -- this was merged after some rebase and modifications this weekend. |
|
superseded by merged #4871 |
Delay numpy import until we build the extensions. This allows commands
like
egg_infoto collect dependencies without crashing out with amissing numpy.
Therefore, pip should be able to install numpy during the build process.
See: scipy/scipy.org#179 for discussion.