Skip to content

[MR+3] CI dropping python-3.5 - #15106

Merged
adrinjalali merged 28 commits into
scikit-learn:masterfrom
adrinjalali:ci/drop-3.5
Feb 10, 2020
Merged

adrinjalali merged 28 commits into
scikit-learn:masterfrom
adrinjalali:ci/drop-3.5

Conversation

@adrinjalali

@adrinjalali adrinjalali commented Sep 28, 2019 •

Copy link
Copy Markdown
Member

Related to #14449.

This PR drops support for python=3.5.

Please note that there are a few consequences:

Python 3.5 was/is the default python in ubuntu 16.04. Moving to python=3.6 means we either move the CI entirely to conda envs, or move the ubuntu images in the CI to ubuntu 18.04, which has a python=3.6 as the default python3.

This PR uses Ubuntu 18.04 as the baseline, and the corresponding packages:
numpy=1.13
scipy=0.19
matplotlib=2.1.1

@adrinjalali

Copy link
Copy Markdown
Member Author

Azure still hasn't added the 18.04 image (https://github.com/Microsoft/azure-pipelines-image-generation/issues/506). Do we want to use a docker image like numpy does:

https://github.com/numpy/numpy/blob/68bd6e359a6b0863acf39cad637e1444d78eabd0/azure-pipelines.yml#L16-L34

    vmImage: 'ubuntu-16.04'
  steps:
  - script: |
           docker pull i386/ubuntu:bionic
           docker run -v $(pwd):/numpy i386/ubuntu:bionic /bin/bash -c "cd numpy && \
           apt-get -y update && \
           apt-get -y install python3.6-dev python3-pip locales python3-certifi && \
           locale-gen fr_FR && update-locale && \
           apt-get -y install gfortran-5 wget && \
           target=\$(python3 tools/openblas_support.py) && \
           cp -r \$target/usr/local/lib/* /usr/lib && \
           cp \$target/usr/local/include/* /usr/include && \
           python3 -m pip install --user --upgrade pip setuptools && \
           python3 -m pip install --user -r test_requirements.txt && \
           python3 -m pip install . && \
           F77=gfortran-5 F90=gfortran-5 \
           CFLAGS='-UNDEBUG -std=c99' python3 runtests.py -n --debug-configure --mode=full -- -rsx --junitxml=junit/test-results.xml && \
           python3 tools/openblas_support.py --check_version $(OpenBLAS_version)"
    displayName: 'Run 32-bit Ubuntu Docker Build / Tests'

Or do we want to use only conda?

(I also really would like to just have docker images for each test case instead of installing all those packages on each commit for all those machines. It hurts me to waste so much time/energy on those machines).

WDYT @thomasjpfan

@thomasjpfan

Copy link
Copy Markdown
Member

The numpy azure config uses a docker image to test 32bit linux, which is what we currently do. They use TravisCI for their linux tests.

From my understanding of #14449, we have not decided to drop 3.5 yet.

@adrinjalali

Copy link
Copy Markdown
Member Author

@thomasjpfan I thought trying it out may reveal things which may influence our decision. Since the NEP is kinda accepted, and pandas is also dropping 3.5 for the November release, I thought it'd be nice to see at least how it works.

Also, the NamedArray for feature_names_out_ requires numpy>=1.13, which is satisfied as a happy side effect of dropping 3.5

@rth

rth commented Oct 7, 2019

Copy link
Copy Markdown
Member

From my understanding of #14449, we have not decided to drop 3.5 yet.

Well Python 3.8 is released next Monday. If we support 3 latest versions, we could drop 3.5 then? Also maybe this would be a lazy fix for #14168 and all the issues with Python 3.5 CI we had in conda lately.

Otherwise this means that we would need to keep it until the last minor release is done in the 0.22.X series which could take another 6 months.

@adrinjalali

Copy link
Copy Markdown
Member Author

I think this is ready for a review. The failing tests have their corresponding issues.

@thomasjpfan

Copy link
Copy Markdown
Member

For reference, the remaining issue is #16013

@rth

rth commented Jan 12, 2020

Copy link
Copy Markdown
Member

For reference, the remaining issue is #16013

I don't think it should be a blocker to merge this. I am fine with marking that test as a known failure for for CI with Py36 32bit, since it's not a new failure, but we are just not testing for it at the moment in those conditions as far as I understand.

@rth rth left a comment

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.

Thanks for continuing working in this @adrinjalali ! LGTM, once the failing test with 32bit is marked as a known failure.

@NicolasHug

Copy link
Copy Markdown
Member

Has numpy dropped 3.5 support? I can't find the PR.

We should probably sync with the other packages of the ecosystem to make sure we're not the only one actually applying the NEP?

@rth

rth commented Jan 12, 2020

Copy link
Copy Markdown
Member

Has numpy dropped 3.5 support? I can't find the PR.

Pandas did I think and from pandas-dev/pandas#29034 (comment)

numpy.org/neps/nep-0029-deprecation_policy.html has September 2019 as the cutoff for 3.5.

@NicolasHug

Copy link
Copy Markdown
Member

we can, but why?

To avoid having to move to ubuntu 18.04 which would avoid having to bump our minimal requirements

those old versions of our dependencies don't support 3.6 AFAIK

I don't see how a library can support 3.5 but not 3.6?

@rth

rth commented Jan 21, 2020 •

Copy link
Copy Markdown
Member

I don't see how a library can support 3.5 but not 3.6?

numpy 1.11.3 was released a few days before Python 3.6 on Dec. 23, 2016 and explicitly supports 2.6 - 2.7 and 3.2 - 3.5. While 3.6 would probably work maybe with a few warnings, there are no wheels for it on PyPi for Windows. If the tar.gz was cythonized with an older cython that didn't support 3.6 it may also fail to compile from PyPi.

For comparison, the upcoming

so numpy 1.13.3+ for the next release would be consistent with the rest of the ecosystem, unless we have a reason support older numpy versions. scipy=0.19 and matplotlib=2.1.1 were also released around that time.

@adrinjalali

Copy link
Copy Markdown
Member Author

Should we merge then? @NicolasHug ? ;)

@NicolasHug NicolasHug left a comment

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.

Thanks Adrin, LGTM. I guess we can start using f-strings now \o/

pinging @scikit-learn/core-devs since this is an important change

#!/bin/bash

set -e
set -x

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.

was this just for debugging or do we still need it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It was for debugging, but we have it in a few other scripts and I find it easier to debug whenever an issue happens, instead of putting it there every time we need it.

@rth

rth commented Feb 6, 2020

Copy link
Copy Markdown
Member

BTW, projects that migrated to pyproject.toml (#16244) can get a nice correspondence between Python versions and minimal supported numpy versions, with https://pypi.org/project/oldest-supported-numpy/ as mentioned by @jeremiedbb in that PR,

    "numpy==1.13.3; python_version=='3.5',
    "numpy==1.13.3; python_version=='3.6',
    "numpy==1.14.5; python_version=='3.7',
    "numpy==1.17.3; python_version>='3.8'

so when we drop 3.6, it should indeed be numpy 1.13.3+

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

also removed a bit of code which was there for numpy<1.13

#!/bin/bash

set -e
set -x

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It was for debugging, but we have it in a few other scripts and I find it easier to debug whenever an issue happens, instead of putting it there every time we need it.

@GaelVaroquaux GaelVaroquaux left a comment

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.

LGTM. Thank you!

@GaelVaroquaux GaelVaroquaux changed the title CI dropping python-3.5 [MR+3] CI dropping python-3.5 Feb 7, 2020
@GaelVaroquaux

Copy link
Copy Markdown
Member

I approved, but did not merge (though we have a lot of approval on this PR), to give time for others to voice concerns, if any.

Comment thread sklearn/utils/_mask.py Resolved
Comment thread sklearn/utils/_mask.py Resolved
Comment thread sklearn/utils/fixes.py Resolved

@ogrisel ogrisel left a comment

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.

LGTM besides the following:

Comment thread README.rst Resolved
Comment thread doc/install.rst Resolved
@ogrisel

ogrisel commented Feb 7, 2020

Copy link
Copy Markdown
Member

Yeah for f-strings!

@ogrisel

ogrisel commented Feb 7, 2020

Copy link
Copy Markdown
Member

Also what about type hints?

@GaelVaroquaux

GaelVaroquaux commented Feb 7, 2020 via email

Copy link
Copy Markdown
Member

@rth

rth commented Feb 10, 2020

Copy link
Copy Markdown
Member

Also what about type hints?

Some light type hints would be great. See earlier discussion in #11170

@adrinjalali
adrinjalali merged commit 42706eb into scikit-learn:master Feb 10, 2020
@adrinjalali
adrinjalali deleted the ci/drop-3.5 branch February 10, 2020 11:28
thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Feb 22, 2020
* dropping python-3.5

* fix install guide

* fix setup.py

* fix circleci

* advanced_installation

* index.html

* readme

* pyparsing.py

* remove clean_warning_registry

* 1.13.1 and 1.19.1

* don't use 16.04

* 18.04 libatlas-dev -> libatlas-base-dev

* min pillow version for 3.6 is 4.2.1

* echo commands

* fix conflict, and 32 bit

* fix conflict for circle

* fix scikit-image version dep

* mark tests as xfail on 32bit py3.6

* move to 1.13.3 min numpy version, and simplify old code

* remove the rest of _object_dtype_isnan usages

* Revert "remove the rest of _object_dtype_isnan usages"

This reverts commit c6e867e.

* fix issues raised by jeremy

* minor fix

* minor fixes mentioned by Olivier
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
* dropping python-3.5

* fix install guide

* fix setup.py

* fix circleci

* advanced_installation

* index.html

* readme

* pyparsing.py

* remove clean_warning_registry

* 1.13.1 and 1.19.1

* don't use 16.04

* 18.04 libatlas-dev -> libatlas-base-dev

* min pillow version for 3.6 is 4.2.1

* echo commands

* fix conflict, and 32 bit

* fix conflict for circle

* fix scikit-image version dep

* mark tests as xfail on 32bit py3.6

* move to 1.13.3 min numpy version, and simplify old code

* remove the rest of _object_dtype_isnan usages

* Revert "remove the rest of _object_dtype_isnan usages"

This reverts commit c6e867e.

* fix issues raised by jeremy

* minor fix

* minor fixes mentioned by Olivier
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.

8 participants