Skip to content

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

Closed
barrywhart wants to merge 6 commits into
scikit-learn:masterfrom
barrywhart:issue_7867_build_and_install_requirements
Closed

barrywhart wants to merge 6 commits into
scikit-learn:masterfrom
barrywhart:issue_7867_build_and_install_requirements

Conversation

@barrywhart

@barrywhart barrywhart commented Jan 4, 2018 •

Copy link
Copy Markdown
Contributor

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

njsmith commented Jan 4, 2018

Copy link
Copy Markdown

See #7867 (comment)

@barrywhart

Copy link
Copy Markdown
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

lesteve commented Jan 4, 2018

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment thread setup.py
# 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
Copy Markdown
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?

Comment thread setup.py

if build_requires:
metadata.update(
setup_requires=build_requires,

Copy link
Copy Markdown
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