Skip to content

Do not pre-cythonize when calling sdist #15567

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

Merged
merged 3 commits into from
Nov 8, 2019

Conversation

ogrisel
Copy link
Member

@ogrisel ogrisel commented Nov 8, 2019

Pre-generated c/cpp source files from Cython are not guaranteed to be forward with future Python releases. This PR changes the setup.py to always require a recent version of Cython when building scikit-learn from source.

This is a variant of #15533 that does not try to attempt to automatically install the build dependencies (numpy, scipy and cython) using a pyproject.toml file because of how pip current work.

See the discussion in #15533 for more details.

This means that cython must be installed manually first when building
scikit-t learn from a source tarball for future releases.

In case Cython is missing or too old, an informative error message is
raised.
@jeremiedbb
Copy link
Member

So just to be sure, this PR will only affect people who install sklearn by downloading the source distribution right ?

@ogrisel
Copy link
Member Author

ogrisel commented Nov 8, 2019

So just to be sure, this PR will only affect people who install sklearn by downloading the source distribution right?

Yes.

For users building from a git clone, it will also give a more informative error message when Cython is missing or too old.

@ogrisel
Copy link
Member Author

ogrisel commented Nov 8, 2019

I also fixed the ability to do python setup.py dist_info which was broken for no valid reason.

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

Awesome, thanks a bunch @ogrisel

@jeremiedbb jeremiedbb merged commit 82e2f54 into scikit-learn:master Nov 8, 2019
@jeremiedbb
Copy link
Member

thanks @ogrisel !

@ogrisel ogrisel deleted the no-cythonize-sdist branch November 8, 2019 12:21
@jeremiedbb
Copy link
Member

Just realized: should we add a what's new entry to mention that now cython is required when building from source distribution ?

@adrinjalali
Copy link
Member

Not sure about a whats_new entry. I'm happy with or without.

@thomasjpfan
Copy link
Member

We are basing our minimum Cython version on the newest version on conda supporting Python 3.5. Can we try to keep the Cython version up to date with the latest Cython release?

@adrinjalali
Copy link
Member

Sounds like a good idea to me. We're only doing that to have a passing CI, as long as the CI passes, I'm happy to have the latest possible Cython.

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