Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
MechCoder merged 2 commits into
scikit-learn:masterfrom
arthurmensch:remove_cython
Nov 11, 2015
Merged

[MRG + 2] Removing generated C files, adding build cache to Travis#5492
MechCoder merged 2 commits into
scikit-learn:masterfrom
arthurmensch:remove_cython

Conversation

@arthurmensch

Copy link
Copy Markdown
Contributor

Still to do :

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

Comment thread setup.py Outdated

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.

Pretty sure pep8 complains about this ;)

@arthurmensch

Copy link
Copy Markdown
Contributor Author

Looks like it's working

@glouppe glouppe changed the title Removing cython files [WIP] Removing generated C files Oct 21, 2015
Comment thread continuous_integration/install.sh Outdated

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.

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

@amueller

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

Comment thread tools/cythonize.py Outdated

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

arjoly commented Oct 21, 2015

Copy link
Copy Markdown
Member

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

Comment thread continuous_integration/install.sh Outdated

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.

a small mistake here?

Comment thread circle.yml Outdated

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.

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

Copy link
Copy Markdown
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" [email protected] 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
Copy Markdown
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
Copy Markdown
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" [email protected] 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

amueller commented Nov 4, 2015

Copy link
Copy Markdown
Member

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

amueller commented Nov 4, 2015

Copy link
Copy Markdown
Member

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

@MechCoder

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

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

@arthurmensch

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

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

@amueller

amueller commented Nov 5, 2015

Copy link
Copy Markdown
Member

hm sorry stopped the build

@arthurmensch

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

@amueller brave enough to merge?

@MechCoder

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

Thanks ! @arthurmensch :-)

@MechCoder

Copy link
Copy Markdown
Member

On a lighter note,

2748874

@raghavrv

Copy link
Copy Markdown
Member

lol!

@arjoly

arjoly commented Nov 13, 2015

Copy link
Copy Markdown
Member

Great!! thanks @arthurmensch !

@amueller

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

9 participants