Skip to content

MAINT Drop official PyPy support #29128

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 7 commits into from
Jun 3, 2024

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented May 28, 2024

As discussed at the developer meeting.

Close #27662, close #28956.

Here is a summary of the motivations:

There is very little scikit-learn + PyPy usage

  • No PyPy + numpy usage were reported in this HN question by @mattip.
  • No user said "yes I used scikit-learn + PyPy and I care about this" in Olivier's social media posts, see PyPy tests timeouts / memory usage investigation #27662 (comment).
  • the only way to install scikit-learn with PyPy without building from source is conda-forge. There is no scipy PyPy wheel and there is no scikit-learn PyPy wheel.
  • last available scikit-learn version on conda-forge is 1.0.2 and noone has ever complained about this in the last two years and a half.
  • Download stats on conda-forge are quite low, see https://anaconda.org/conda-forge/scikit-learn/files?version=1.0.2. The PyPy scikit-learn package has py37hca48384_0 in its filename (mamba create -n pypy scikit-learn tells you this) and has been downloaded ~2000 times to be compared to the other downloads that amounts to ~3 million downloads.

Maintenance has a cost

Changes in this PR

  • Update of the FAQ to say that PyPy is not officially supported
  • Remove the CI build and lock-files
  • Update of the scikit-learn code that had some PyPy-specific code. These changes could be reverted if we want to say: "PyPy is not tested but simple fix PRs may be accepted"
  • update of the tests in particular the PyPy-specific markers to skip some tests when run under PyPy

As things stand in this PR, PyPy is mentioned only in the FAQ, some old changelog, setup.py (no need to tweak this since setup.py will go away soonish), and because sklearn.utils.IS_PYPY is deprecated and scheduled to be removed in scikit-learn 1.7:

❯ git grep -i pypy
doc/faq.rst:Do you support PyPy?
doc/faq.rst:scikit-learn with `PyPy <https://pypy.org/>`_ (an alternative Python
doc/whats_new/v0.20.rst:- |Feature| Add almost complete PyPy 3 support. Known unsupported
doc/whats_new/v0.20.rst:  :class:`feature_extraction.text.HashingVectorizer`. For running on PyPy,
doc/whats_new/v0.20.rst:  PyPy3-v5.10+, Numpy 1.14.0+, and scipy 1.1.0+ are required.
doc/whats_new/v1.1.rst:- |Feature| :class:`feature_extraction.FeatureHasher` now supports PyPy.
doc/whats_new/v1.2.rst:  `nu=0.5` for PyPy (and possibly other non CPython interpreters). :pr:`24245`
doc/whats_new/v1.4.rst:- |Fix| fixes a memory leak seen in PyPy for estimators using the Cython loss functions.
doc/whats_new/v1.5.rst:- |API| :data:`utils.IS_PYPY` is deprecated and will be removed in version 1.7.
setup.py:            "compile_for_pypy": False,
setup.py:    is_pypy = platform.python_implementation() == "PyPy"
setup.py:            if is_pypy and not extension.get("compile_for_pypy", True):
sklearn/externals/_arff.py:- Fully compatible with Python 2.7+, Python 3.5+, pypy and pypy3;
sklearn/utils/__init__.py:    if name == "IS_PYPY":
sklearn/utils/__init__.py:            "IS_PYPY is deprecated and will be removed in 1.7.",
sklearn/utils/__init__.py:        return platform.python_implementation() == "PyPy"
sklearn/utils/tests/test_utils.py:def test_is_pypy_deprecated():
sklearn/utils/tests/test_utils.py:    with pytest.warns(FutureWarning, match="IS_PYPY is deprecated"):
sklearn/utils/tests/test_utils.py:        from sklearn.utils import IS_PYPY  # noqa

Copy link

github-actions bot commented May 28, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 89b3831. Link to the linter CI: here

@lesteve lesteve force-pushed the drop-official-pypy-support branch from f4dae1a to 0a8d083 Compare May 28, 2024 14:43
Copy link
Member

@betatim betatim left a comment

Choose a reason for hiding this comment

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

I think this is a good move. We can always fish things back out of the archive to re-add pypy support (in the sense of "might work or not, fix PRs welcome") if we get contacted by people who rely on this.

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.

Looking at this PR makes me realize we REALLY don't support PyPy. So I'm very happy to not mislead people that we somewhat do.

@jjerphan
Copy link
Member

jjerphan commented Jun 4, 2024

Thank you, @lesteve. 🙏

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.

PyPy tests timeouts / memory usage investigation
4 participants