Skip to content

[MRG] Make pip install numpy and scipy for us #10398

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

Conversation

barrywhart
Copy link
Contributor

@barrywhart barrywhart commented Jan 4, 2018

This PR modifies setup.py to include numpy and scipy as setup dependencies. Thus, running pip install scikit-learn will automatically install these libraries if needed. This code was adapted from scipy.

Fix #7867.

@barrywhart barrywhart changed the title [MRG] Partially address issue 7867: Make pip install scipy when installing scikit-learn [WIP] Partially address issue 7867: Make pip install scipy when installing scikit-learn Jan 4, 2018
barrywhart and others added 3 commits January 3, 2018 22:05
Remove unnecessary blank line (flake8)
Suppress flake8 error on an import that we do just to see if the library is present
@barrywhart barrywhart changed the title [WIP] Partially address issue 7867: Make pip install scipy when installing scikit-learn [WIP] Issue 7867: Make pip install numpy and scipy for us Jan 4, 2018
@njsmith
Copy link

njsmith commented Jan 4, 2018

See #7867 (comment)

@barrywhart
Copy link
Contributor Author

The last build looked good except the Python 2.7 tests hung and were killed. I'm pretty sure this was unrelated to my changes, so I pushed an empty commit to trigger a new build.

@barrywhart barrywhart changed the title [WIP] Issue 7867: Make pip install numpy and scipy for us [MRG] Issue 7867: Make pip install numpy and scipy for us Jan 4, 2018
@lesteve
Copy link
Member

lesteve commented Jan 4, 2018

Please follow @njsmith recommendation. He is an expert on this packaging issues and he thinks that's the best practice, then that is how we should do it.

Can you commit something following his approach and if that does not work as you seemed to say in the related issue, we'll try to figure out why.

@lesteve lesteve changed the title [MRG] Issue 7867: Make pip install numpy and scipy for us [MRG] Make pip install numpy and scipy for us Jan 4, 2018
@barrywhart
Copy link
Contributor Author

I created a separate PR so we can evaluate the other approach:
#10402

This gives us the flexibility to choose which one to merge and which one to close.

# for this platform, so it is safe to add numpy to build requirements.
build_requires += (
['numpy>={0}'.format(NUMPY_MIN_VERSION)]
if 'bdist_wheel' in sys.argv[1:] else [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be clearer as an if statement rather than appending an empty list.

Also, in the case where we add [], should we be checking that the numpy version meets minimum requirements?


if build_requires:
metadata.update(
setup_requires=build_requires,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @njsmith was saying we should not use this...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants