From c6f4ca6190b300596500e896b47bde36241f8213 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 08:29:40 -0800 Subject: [PATCH 1/9] drop python 2 support and associated ci mods --- .travis.yml | 3 +- appveyor.yml | 9 +++--- ci/requirements-py27-cdat+iris+pynio.yml | 30 ------------------- ci/requirements-py27-min.yml | 11 ------- ...dows.yml => requirements-py37-windows.yml} | 10 +++---- ci/requirements-py37.yml | 3 ++ doc/installing.rst | 14 ++------- doc/whats-new.rst | 4 +++ setup.py | 2 ++ 9 files changed, 20 insertions(+), 66 deletions(-) delete mode 100644 ci/requirements-py27-cdat+iris+pynio.yml delete mode 100644 ci/requirements-py27-min.yml rename ci/{requirements-py27-windows.yml => requirements-py37-windows.yml} (74%) diff --git a/.travis.yml b/.travis.yml index 8c2ee3ab0d5..fbb7221d7ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,7 @@ branches: matrix: fast_finish: true include: - - env: CONDA_ENV=py27-min - - env: CONDA_ENV=py27-cdat+iris+pynio + - env: CONDA_ENV=py35-min - env: CONDA_ENV=py35 - env: CONDA_ENV=py36 - env: CONDA_ENV=py37 diff --git a/appveyor.yml b/appveyor.yml index 7020adae572..347883b96cb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,15 +7,14 @@ branches: environment: matrix: - - PYTHON: "C:\\Python27-conda64" - PYTHON_VERSION: "2.7" - PYTHON_ARCH: "64" - CONDA_ENV: "py27-windows" - - PYTHON: "C:\\Python36-conda64" PYTHON_VERSION: "3.6" PYTHON_ARCH: "64" CONDA_ENV: "py36-windows" + - PYTHON: "C:\\Python37-conda64" + PYTHON_VERSION: "3.7" + PYTHON_ARCH: "64" + CONDA_ENV: "py37-windows" install: # Install miniconda Python diff --git a/ci/requirements-py27-cdat+iris+pynio.yml b/ci/requirements-py27-cdat+iris+pynio.yml deleted file mode 100644 index 116e323d517..00000000000 --- a/ci/requirements-py27-cdat+iris+pynio.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: test_env -channels: - - conda-forge -dependencies: - - python=2.7 - - cdat-lite - - cftime - - cyordereddict - - dask - - distributed - - h5py - - h5netcdf - - matplotlib - - netcdf4 - - numpy - - pandas - - pathlib2 - - pynio - - pytest - - flake8 - - mock - - scipy - - seaborn - - toolz - - rasterio - - iris>=1.10 - - zarr - - pip: - - coveralls - - pytest-cov diff --git a/ci/requirements-py27-min.yml b/ci/requirements-py27-min.yml deleted file mode 100644 index 118b629271e..00000000000 --- a/ci/requirements-py27-min.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: test_env -dependencies: - - python=2.7 - - pytest - - flake8 - - mock - - numpy=1.12 - - pandas=0.19 - - pip: - - coveralls - - pytest-cov diff --git a/ci/requirements-py27-windows.yml b/ci/requirements-py37-windows.yml similarity index 74% rename from ci/requirements-py27-windows.yml rename to ci/requirements-py37-windows.yml index 967b7c584b9..62f08318087 100644 --- a/ci/requirements-py27-windows.yml +++ b/ci/requirements-py37-windows.yml @@ -2,16 +2,15 @@ name: test_env channels: - conda-forge dependencies: - - python=2.7 + - python=3.6 + - cftime - dask - distributed - h5py - h5netcdf - matplotlib - - pathlib2 + - netcdf4 - pytest - - flake8 - - mock - numpy - pandas - scipy @@ -19,5 +18,4 @@ dependencies: - toolz - rasterio - zarr - - pip: - - netcdf4 + diff --git a/ci/requirements-py37.yml b/ci/requirements-py37.yml index 6292c4c5eb6..e54011d4bb0 100644 --- a/ci/requirements-py37.yml +++ b/ci/requirements-py37.yml @@ -22,6 +22,9 @@ dependencies: - zarr - pseudonetcdf>=3.0.1 - eccodes + - cdat-lite + - pynio + - iris>=1.10 - pip: - coveralls - pytest-cov diff --git a/doc/installing.rst b/doc/installing.rst index fbe6a316936..083ac6c450a 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -6,7 +6,7 @@ Installation Required dependencies --------------------- -- Python 2.7 [1]_, 3.5, 3.6, or 3.7 +- Python 3.5, 3.6, or 3.7 - `numpy `__ (1.12 or later) - `pandas `__ (0.19.2 or later) @@ -111,14 +111,4 @@ To run these benchmark tests in a local machine, first install - `airspeed-velocity `__: a tool for benchmarking Python packages over their lifetime. and run -``asv run # this will install some conda environments in ./.asv/envs`` - -.. [1] Xarray plans to drop support for python 2.7 at the end of 2018. This - means that new releases of xarray published after this date will only be - installable on python 3+ environments, but older versions of xarray will - always be available to python 2.7 users. For more information see the - following references: - - - `Xarray Github issue discussing dropping Python 2 `__ - - `Python 3 Statement `__ - - `Tips on porting to Python 3 `__ +``asv run # this will install some conda environments in ./.asv/envs`` \ No newline at end of file diff --git a/doc/whats-new.rst b/doc/whats-new.rst index ea3a12aae0d..b1c80ced761 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -21,6 +21,10 @@ v0.11.2 (unreleased) Breaking changes ~~~~~~~~~~~~~~~~ +- Remove support for Python 2. This is the first version of xarray that is + Python 3 only. (:issue:`1876`). + By `Joe Hamman `_. + Enhancements ~~~~~~~~~~~~ diff --git a/setup.py b/setup.py index eaf57dff81d..1fd8bf5f376 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ 'Topic :: Scientific/Engineering', ] +PYTHON_REQUIRES = '>=3.5' INSTALL_REQUIRES = ['numpy >= 1.12', 'pandas >= 0.19.2'] SETUP_REQUIRES = ['pytest-runner >= 4.2'] TESTS_REQUIRE = ['pytest >= 2.7.1'] @@ -66,6 +67,7 @@ classifiers=CLASSIFIERS, description=DESCRIPTION, long_description=LONG_DESCRIPTION, + python_requires=PYTHON_REQUIRES, install_requires=INSTALL_REQUIRES, setup_requires=SETUP_REQUIRES, tests_require=TESTS_REQUIRE, From 70d1fc4618db6d939f6ae4fbe788975b5782e4d9 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 08:38:46 -0800 Subject: [PATCH 2/9] add py35-min env file --- ci/requirements-py35-min.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ci/requirements-py35-min.yml diff --git a/ci/requirements-py35-min.yml b/ci/requirements-py35-min.yml new file mode 100644 index 00000000000..eb28b4c459e --- /dev/null +++ b/ci/requirements-py35-min.yml @@ -0,0 +1,11 @@ +name: test_env +dependencies: + - python=3.5 + - pytest + - flake8 + - mock + - numpy=1.12 + - pandas=0.19 + - pip: + - coveralls + - pytest-cov \ No newline at end of file From c008e20120e7dd0a02e145289cb2ee584857d4e5 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 08:40:09 -0800 Subject: [PATCH 3/9] fix python version in py37-windows env --- ci/requirements-py37-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements-py37-windows.yml b/ci/requirements-py37-windows.yml index 62f08318087..e9cc7d0f556 100644 --- a/ci/requirements-py37-windows.yml +++ b/ci/requirements-py37-windows.yml @@ -2,7 +2,7 @@ name: test_env channels: - conda-forge dependencies: - - python=3.6 + - python=3.7 - cftime - dask - distributed From a0919732bc7825aeafe1b5f262fc999cba6da85d Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 08:47:21 -0800 Subject: [PATCH 4/9] fix setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 1fd8bf5f376..ac226c4cab5 100644 --- a/setup.py +++ b/setup.py @@ -72,6 +72,5 @@ setup_requires=SETUP_REQUIRES, tests_require=TESTS_REQUIRE, url=URL, - python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*', packages=find_packages(), package_data={'xarray': ['tests/data/*']}) From 2cac7d4e864624699ba7a1caad1dbc344e2ca7dd Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 13:10:54 -0800 Subject: [PATCH 5/9] move iris and pynio to py36 env --- ci/requirements-py36.yml | 3 +++ ci/requirements-py37.yml | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/requirements-py36.yml b/ci/requirements-py36.yml index 321f3087ea2..00dc1f2fb0a 100644 --- a/ci/requirements-py36.yml +++ b/ci/requirements-py36.yml @@ -22,6 +22,9 @@ dependencies: - zarr - pseudonetcdf>=3.0.1 - eccodes + # - cdat-lite # No py3 support + - pynio + - iris>=1.10 - pip: - coveralls - pytest-cov diff --git a/ci/requirements-py37.yml b/ci/requirements-py37.yml index e54011d4bb0..6292c4c5eb6 100644 --- a/ci/requirements-py37.yml +++ b/ci/requirements-py37.yml @@ -22,9 +22,6 @@ dependencies: - zarr - pseudonetcdf>=3.0.1 - eccodes - - cdat-lite - - pynio - - iris>=1.10 - pip: - coveralls - pytest-cov From 74aa939afeff9cc3d440e4657fe2a7127d1e04d2 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 15:56:46 -0800 Subject: [PATCH 6/9] add cdms2 to 36 test env --- ci/requirements-py36.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements-py36.yml b/ci/requirements-py36.yml index 00dc1f2fb0a..abdc46784f7 100644 --- a/ci/requirements-py36.yml +++ b/ci/requirements-py36.yml @@ -22,7 +22,7 @@ dependencies: - zarr - pseudonetcdf>=3.0.1 - eccodes - # - cdat-lite # No py3 support + - cdms2 - pynio - iris>=1.10 - pip: From cd2457223e89a69424f514aa096a9fbb74fb2820 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 20:17:44 -0800 Subject: [PATCH 7/9] testing with UVCDAT_ANONYMOUS_LOG=no --- .travis.yml | 4 +++- ci/requirements-py35-min.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fbb7221d7ea..07c8f009e8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,9 @@ matrix: include: - env: CONDA_ENV=py35-min - env: CONDA_ENV=py35 - - env: CONDA_ENV=py36 + - env: + - CONDA_ENV=py36 + - UVCDAT_ANONYMOUS_LOG=no - env: CONDA_ENV=py37 - env: - CONDA_ENV=py36 diff --git a/ci/requirements-py35-min.yml b/ci/requirements-py35-min.yml index eb28b4c459e..fad58905262 100644 --- a/ci/requirements-py35-min.yml +++ b/ci/requirements-py35-min.yml @@ -8,4 +8,4 @@ dependencies: - pandas=0.19 - pip: - coveralls - - pytest-cov \ No newline at end of file + - pytest-cov From 39efbaf74ef9948551470823dd029908d7c60810 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 31 Dec 2018 20:38:44 -0800 Subject: [PATCH 8/9] use pytest-env --- .travis.yml | 4 +--- ci/requirements-py35-min.yml | 6 +++--- ci/requirements-py35.yml | 6 +++--- ci/requirements-py36-bottleneck-dev.yml | 5 +++-- ci/requirements-py36-condaforge-rc.yml | 6 +++--- ci/requirements-py36-dask-dev.yml | 5 +++-- ci/requirements-py36-hypothesis.yml | 12 ++++++------ ci/requirements-py36-netcdf4-dev.yml | 5 +++-- ci/requirements-py36-pandas-dev.yml | 5 +++-- ci/requirements-py36-pynio-dev.yml | 8 ++++---- ci/requirements-py36-rasterio.yml | 8 ++++---- ci/requirements-py36-windows.yml | 1 + ci/requirements-py36-zarr-dev.yml | 5 +++-- ci/requirements-py36.yml | 9 +++++---- ci/requirements-py37-windows.yml | 2 +- ci/requirements-py37.yml | 9 +++++---- setup.cfg | 2 ++ 17 files changed, 53 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07c8f009e8f..fbb7221d7ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,7 @@ matrix: include: - env: CONDA_ENV=py35-min - env: CONDA_ENV=py35 - - env: - - CONDA_ENV=py36 - - UVCDAT_ANONYMOUS_LOG=no + - env: CONDA_ENV=py36 - env: CONDA_ENV=py37 - env: - CONDA_ENV=py36 diff --git a/ci/requirements-py35-min.yml b/ci/requirements-py35-min.yml index fad58905262..527a6929484 100644 --- a/ci/requirements-py35-min.yml +++ b/ci/requirements-py35-min.yml @@ -2,10 +2,10 @@ name: test_env dependencies: - python=3.5 - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - mock - numpy=1.12 - pandas=0.19 - - pip: - - coveralls - - pytest-cov diff --git a/ci/requirements-py35.yml b/ci/requirements-py35.yml index 9615aeba9aa..29f4bb020fc 100644 --- a/ci/requirements-py35.yml +++ b/ci/requirements-py35.yml @@ -10,6 +10,9 @@ dependencies: - matplotlib=1.5 - netcdf4 - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - numpy - pandas @@ -18,6 +21,3 @@ dependencies: - toolz - rasterio - zarr - - pip: - - coveralls - - pytest-cov diff --git a/ci/requirements-py36-bottleneck-dev.yml b/ci/requirements-py36-bottleneck-dev.yml index b8619658929..bdf0349b5c0 100644 --- a/ci/requirements-py36-bottleneck-dev.yml +++ b/ci/requirements-py36-bottleneck-dev.yml @@ -11,6 +11,9 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - numpy - pandas @@ -19,5 +22,3 @@ dependencies: - toolz - pip: - git+https://github.com/kwgoodman/bottleneck.git - - coveralls - - pytest-cov diff --git a/ci/requirements-py36-condaforge-rc.yml b/ci/requirements-py36-condaforge-rc.yml index 8436d4e3e83..ba980deeeea 100644 --- a/ci/requirements-py36-condaforge-rc.yml +++ b/ci/requirements-py36-condaforge-rc.yml @@ -12,12 +12,12 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - numpy - pandas - seaborn - scipy - toolz - - pip: - - coveralls - - pytest-cov diff --git a/ci/requirements-py36-dask-dev.yml b/ci/requirements-py36-dask-dev.yml index e580aaf3889..20b10fe29ee 100644 --- a/ci/requirements-py36-dask-dev.yml +++ b/ci/requirements-py36-dask-dev.yml @@ -9,6 +9,9 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - numpy - pandas @@ -20,7 +23,5 @@ dependencies: - zarr - pseudonetcdf>=3.0.1 - pip: - - coveralls - - pytest-cov - git+https://github.com/dask/dask.git - git+https://github.com/dask/distributed.git diff --git a/ci/requirements-py36-hypothesis.yml b/ci/requirements-py36-hypothesis.yml index 29f4ae33538..c5c228095a4 100644 --- a/ci/requirements-py36-hypothesis.yml +++ b/ci/requirements-py36-hypothesis.yml @@ -10,6 +10,10 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env + - pytest-cov + - coveralls + - hypothesis - flake8 - numpy - pandas @@ -19,9 +23,5 @@ dependencies: - rasterio - bottleneck - zarr - - pip: - - coveralls - - pytest-cov - - pydap - - lxml - - hypothesis + - pydap + - lxml diff --git a/ci/requirements-py36-netcdf4-dev.yml b/ci/requirements-py36-netcdf4-dev.yml index a473ceb5b0a..2616a113fa4 100644 --- a/ci/requirements-py36-netcdf4-dev.yml +++ b/ci/requirements-py36-netcdf4-dev.yml @@ -10,13 +10,14 @@ dependencies: - h5netcdf - matplotlib - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - numpy - pandas - scipy - toolz - pip: - - coveralls - - pytest-cov - git+https://github.com/Unidata/netcdf4-python.git - git+https://github.com/Unidata/cftime.git diff --git a/ci/requirements-py36-pandas-dev.yml b/ci/requirements-py36-pandas-dev.yml index 1f1acabcae9..2b914f746ab 100644 --- a/ci/requirements-py36-pandas-dev.yml +++ b/ci/requirements-py36-pandas-dev.yml @@ -12,11 +12,12 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - numpy - scipy - toolz - pip: - - coveralls - - pytest-cov - git+https://github.com/pydata/pandas.git diff --git a/ci/requirements-py36-pynio-dev.yml b/ci/requirements-py36-pynio-dev.yml index 2caaa8affe5..b8987611a6e 100644 --- a/ci/requirements-py36-pynio-dev.yml +++ b/ci/requirements-py36-pynio-dev.yml @@ -13,6 +13,9 @@ dependencies: - netcdf4 - pynio=dev - pytest + - pytest-env + - pytest-cov + - coveralls - numpy - pandas - scipy @@ -20,7 +23,4 @@ dependencies: - toolz - rasterio - bottleneck - - pip: - - coveralls - - pytest-cov - - pydap + - pydap diff --git a/ci/requirements-py36-rasterio.yml b/ci/requirements-py36-rasterio.yml index 2ec75f5d8b2..dda9ea8cd29 100644 --- a/ci/requirements-py36-rasterio.yml +++ b/ci/requirements-py36-rasterio.yml @@ -11,6 +11,9 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env + - pytest-cov + - coveralls - numpy - pandas - scipy @@ -18,7 +21,4 @@ dependencies: - toolz - rasterio>=1.0 - bottleneck - - pip: - - coveralls - - pytest-cov - - pydap + - pydap diff --git a/ci/requirements-py36-windows.yml b/ci/requirements-py36-windows.yml index 62f08318087..b139d5c78ca 100644 --- a/ci/requirements-py36-windows.yml +++ b/ci/requirements-py36-windows.yml @@ -11,6 +11,7 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env - numpy - pandas - scipy diff --git a/ci/requirements-py36-zarr-dev.yml b/ci/requirements-py36-zarr-dev.yml index 6ed466ba5cb..9966cf74815 100644 --- a/ci/requirements-py36-zarr-dev.yml +++ b/ci/requirements-py36-zarr-dev.yml @@ -8,6 +8,9 @@ dependencies: - distributed - matplotlib - pytest + - pytest-env + - pytest-cov + - coveralls - flake8 - numpy - pandas @@ -16,6 +19,4 @@ dependencies: - toolz - bottleneck - pip: - - coveralls - - pytest-cov - git+https://github.com/zarr-developers/zarr.git diff --git a/ci/requirements-py36.yml b/ci/requirements-py36.yml index abdc46784f7..2986dc33adb 100644 --- a/ci/requirements-py36.yml +++ b/ci/requirements-py36.yml @@ -11,6 +11,9 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-cov + - pytest-env + - coveralls - flake8 - numpy - pandas @@ -25,9 +28,7 @@ dependencies: - cdms2 - pynio - iris>=1.10 + - pydap + - lxml - pip: - - coveralls - - pytest-cov - - pydap - - lxml - cfgrib>=0.9.2 diff --git a/ci/requirements-py37-windows.yml b/ci/requirements-py37-windows.yml index e9cc7d0f556..24a7f556b2c 100644 --- a/ci/requirements-py37-windows.yml +++ b/ci/requirements-py37-windows.yml @@ -11,6 +11,7 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-env - numpy - pandas - scipy @@ -18,4 +19,3 @@ dependencies: - toolz - rasterio - zarr - diff --git a/ci/requirements-py37.yml b/ci/requirements-py37.yml index 6292c4c5eb6..86a44ed5398 100644 --- a/ci/requirements-py37.yml +++ b/ci/requirements-py37.yml @@ -11,6 +11,9 @@ dependencies: - matplotlib - netcdf4 - pytest + - pytest-cov + - pytest-env + - coveralls - flake8 - numpy - pandas @@ -21,10 +24,8 @@ dependencies: - bottleneck - zarr - pseudonetcdf>=3.0.1 + - lxml - eccodes + - pydap - pip: - - coveralls - - pytest-cov - - pydap - - lxml - cfgrib>=0.9.2 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index a0d4b46c14e..d5921230bfa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,6 +4,8 @@ universal = 1 [tool:pytest] python_files=test_*.py testpaths=xarray/tests +env = + UVCDAT_ANONYMOUS_LOG=no [flake8] max-line-length=79 From 3fa655f4e497f110711a6eb259e0eaaa938ad560 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Tue, 1 Jan 2019 19:18:10 -0800 Subject: [PATCH 9/9] pip for pytest plugins --- ci/requirements-py35-min.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/requirements-py35-min.yml b/ci/requirements-py35-min.yml index 527a6929484..1f41d0d9dc1 100644 --- a/ci/requirements-py35-min.yml +++ b/ci/requirements-py35-min.yml @@ -2,10 +2,11 @@ name: test_env dependencies: - python=3.5 - pytest - - pytest-env - - pytest-cov - - coveralls - flake8 - mock - numpy=1.12 - pandas=0.19 + - pip: + - pytest-env + - pytest-cov + - coveralls \ No newline at end of file