Skip to content
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

[MRG + 2] Removing generated C files, adding build cache to Travis #5492

Merged
merged 2 commits into from
Nov 11, 2015

Conversation

arthurmensch
Copy link
Contributor

Still to do :

  • add cache to travis so that it does not cythonize + build at every commit in each PR

@@ -189,8 +219,8 @@ def setup_package():
**extra_setuptools_args)

if (len(sys.argv) >= 2
and ('--help' in sys.argv[1:] or sys.argv[1]
in ('--help-commands', 'egg_info', '--version', 'clean'))):
and ('--help' in sys.argv[1:] or sys.argv[1]
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure pep8 complains about this ;)

@arthurmensch
Copy link
Contributor Author

Looks like it's working

@glouppe glouppe changed the title Removing cython files [WIP] Removing generated C files Oct 21, 2015
chmod +x miniconda.sh && ./miniconda.sh -b
export PATH=/home/travis/miniconda/bin:$PATH
conda update --yes conda
if [[ "$COVERAGE" == "true" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this but not the other pip installs (nose, cython)

@amueller
Copy link
Member

hm travis shows me nothing when I try to see the logs .. is that just me?

@arthurmensch arthurmensch changed the title [WIP] Removing generated C files [WIP] Removing generated C files, adding build cache to Travis Oct 21, 2015
@arthurmensch
Copy link
Contributor Author

Cythonization + cache is now working on my branch. I am not sure it is 100% reliable but it seems to do the job.

Adding .cache/pip + anaconda folder to cached folder should improve performance as well (see #5455 )

@amueller
Copy link
Member

It would be nice to have travis actually run. not sure that is feasible right now ^^

@arthurmensch arthurmensch changed the title [WIP] Removing generated C files, adding build cache to Travis [MRG] Removing generated C files, adding build cache to Travis Oct 21, 2015
@arthurmensch
Copy link
Contributor Author

Working on my branch, I guess this need review.

I go from 294 s to 104 s of install.sh with build cache.

import subprocess

HASH_FILE = 'cythonize.dat'
DEFAULT_ROOT = 'statsmodels'
Copy link
Contributor

Choose a reason for hiding this comment

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

This should change, and shouldn't we also include the their license ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are cited at the beginning of the file

@arjoly
Copy link
Member

arjoly commented Oct 21, 2015

Can you use flake8 on these files as to clean the style issues?


elif [[ "$DISTRIB" == "ubuntu" ]]; then
# At the time of writing numpy 1.9.1 is included in the travis
# virtualenv but we want to used numpy installed through apt-get
# virtualenv but we want to used nNumpy installed through apt-get
Copy link
Member

Choose a reason for hiding this comment

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

a small mistake here?

@@ -13,6 +13,7 @@ dependencies:
- sudo apt-get install python-numpy python-scipy python-dev python-matplotlib
- sudo apt-get install python-nose python-coverage
- sudo apt-get install python-sphinx
- pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel Cython
Copy link
Member

Choose a reason for hiding this comment

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

Sorry if this is obvious, but why are we depending on astropy's wheels to install Cython?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not obvious, that's because they are the only ones available (they
do not exist in Pypi) - pandas use them as well. I should add a comment
there
Le 3 nov. 2015 18:32, "Manoj Kumar" notifications@github.com a écrit :

In circle.yml
#5492 (comment)
:

@@ -13,6 +13,7 @@ dependencies:
- sudo apt-get install python-numpy python-scipy python-dev python-matplotlib
- sudo apt-get install python-nose python-coverage
- sudo apt-get install python-sphinx

Sorry if this is obvious, but why are we depending on astropy's wheels to
install Cython?


Reply to this email directly or view it on GitHub
https://github.com/scikit-learn/scikit-learn/pull/5492/files#r43779221.

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand. It's right here https://pypi.python.org/pypi/Cython/ so why not just pip install the latest version?

Also out of the two links, one has the Cython version 0.19.1 and the other link raises a 404 error.

(Sorry, I don't know the internals of these well.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to use wheels for alleviating computation
Le 3 nov. 2015 19:48, "Manoj Kumar" notifications@github.com a écrit :

In circle.yml
#5492 (comment)
:

@@ -13,6 +13,7 @@ dependencies:
- sudo apt-get install python-numpy python-scipy python-dev python-matplotlib
- sudo apt-get install python-nose python-coverage
- sudo apt-get install python-sphinx

I don't understand. It's right here https://pypi.python.org/pypi/Cython/
so why not just pip install the latest version?

Also out of the two links, one has the Cython version 0.19.1 and the other
link raises a 404 error.


Reply to this email directly or view it on GitHub
https://github.com/scikit-learn/scikit-learn/pull/5492/files#r43788755.

Copy link
Member

Choose a reason for hiding this comment

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

But this is linux, right? There are no binary wheels, are there?

@arthurmensch
Copy link
Contributor Author

I think we can just use pip install cython, even in Travis as .cache/pip is cached between builds. Circle CI computation time is not that critical anyway.

@arthurmensch
Copy link
Contributor Author

Travis is green and cache is working on all builds -- I'd like to check appveyor though

. The only glitch is that on vanilla ubuntu, installing cython through pip takes a little time, but I don't think it is worth fighting for ~15s.

To install a non dev version, cython is not necessary as .c files are provided in the sdist package. So I will just update the developer section.

@amueller
Copy link
Member

amueller commented Nov 4, 2015

Maybe I'm stupid but why does pip installing take longer than wheel installing on linux?
I agree that the 15s are not really an issue though.

@amueller
Copy link
Member

amueller commented Nov 4, 2015

With this PR you'll be the king of "removed lines" ^^

@MechCoder
Copy link
Member

LGTM !

@MechCoder MechCoder changed the title [MRG + 1] Removing generated C files, adding build cache to Travis [MRG + 2] Removing generated C files, adding build cache to Travis Nov 4, 2015
@GaelVaroquaux
Copy link
Member

Build failed on appveyor. The fail doesn't look completely spurious to me.

@arthurmensch
Copy link
Contributor Author

ImportError: No module named 'sklearn._build_utils'

sklearn/_build_utils/__init__.py exists and Travis passes, is there any way in which python differs for import on Windows ?

@MechCoder
Copy link
Member

That's strange. Would be great if someone could reproduce in a Windows environ

@amueller
Copy link
Member

amueller commented Nov 5, 2015

hm sorry stopped the build

@arthurmensch
Copy link
Contributor Author

Sorry appveyor was failing because I did not register _build_utils submodule in setup.py. Once this PR get merged we will be able to introduce fused types in cython files !

@MechCoder
Copy link
Member

@amueller brave enough to merge?

@MechCoder
Copy link
Member

Merging, since there are 3 +1's :)

MechCoder added a commit that referenced this pull request Nov 11, 2015
[MRG + 2] Removing generated C files, adding build cache to Travis
@MechCoder MechCoder merged commit f49a558 into scikit-learn:master Nov 11, 2015
@MechCoder
Copy link
Member

Thanks ! @arthurmensch :-)

@MechCoder
Copy link
Member

On a lighter note,

2748874

@raghavrv
Copy link
Member

lol!

@arjoly
Copy link
Member

arjoly commented Nov 13, 2015

Great!! thanks @arthurmensch !

@amueller
Copy link
Member

awesome, thanks so much for working on this!

rgommers added a commit to rgommers/scikit-learn that referenced this pull request Feb 14, 2016
pip installs would fail when compiling against ATLAS.
This is due to a distutils-setuptools issue with monkeypatching that
is triggered if Cython is imported.

See numpy/numpy#7235 for details.
mannby pushed a commit to mannby/scikit-learn that referenced this pull request Apr 22, 2016
pip installs would fail when compiling against ATLAS.
This is due to a distutils-setuptools issue with monkeypatching that
is triggered if Cython is imported.

See numpy/numpy#7235 for details.
TomDLT pushed a commit to TomDLT/scikit-learn that referenced this pull request Oct 3, 2016
pip installs would fail when compiling against ATLAS.
This is due to a distutils-setuptools issue with monkeypatching that
is triggered if Cython is imported.

See numpy/numpy#7235 for details.
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.

None yet

9 participants