From da251d96b249b80478675382a35754260d19a0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Mon, 16 Dec 2019 14:44:24 +0100 Subject: [PATCH 1/5] PKG: Explicitly add setuptools dependency --- ci/min_deps_check.py | 3 ++- ci/requirements/doc.yml | 1 + ci/requirements/py36-bare-minimum.yml | 1 + ci/requirements/py36-min-all-deps.yml | 1 + ci/requirements/py36-min-nep18.yml | 1 + ci/requirements/py36.yml | 1 + ci/requirements/py37-windows.yml | 1 + ci/requirements/py37.yml | 1 + ci/requirements/py38.yml | 1 + setup.py | 2 +- 10 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index a5ba90679b7..87f19ec773d 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -22,7 +22,8 @@ "pytest-env", } -POLICY_MONTHS = {"python": 42, "numpy": 24, "pandas": 12, "scipy": 12} +POLICY_MONTHS = {"python": 42, "numpy": 24, "pandas": 12, "scipy": 12, + "setuptools": 12} POLICY_MONTHS_DEFAULT = 6 has_errors = False diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index a0c27a30b01..c6ca789ee1e 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -19,6 +19,7 @@ dependencies: - pandas<0.25 # Hack around https://github.com/pydata/xarray/issues/3369 - rasterio - seaborn + - setuptools - sphinx - sphinx_rtd_theme - zarr diff --git a/ci/requirements/py36-bare-minimum.yml b/ci/requirements/py36-bare-minimum.yml index 05186bc8748..60cd9ad6f98 100644 --- a/ci/requirements/py36-bare-minimum.yml +++ b/ci/requirements/py36-bare-minimum.yml @@ -9,3 +9,4 @@ dependencies: - pytest-env - numpy=1.14 - pandas=0.24 + - setuptools diff --git a/ci/requirements/py36-min-all-deps.yml b/ci/requirements/py36-min-all-deps.yml index 3f10a158f91..779fce8c03a 100644 --- a/ci/requirements/py36-min-all-deps.yml +++ b/ci/requirements/py36-min-all-deps.yml @@ -42,6 +42,7 @@ dependencies: - rasterio=1.0 - scipy=1.0 # Policy allows for 1.2, but scipy>=1.1 breaks numpy=1.14 - seaborn=0.9 + - setuptools # - sparse # See py36-min-nep18.yml - toolz=0.10 - zarr=2.3 diff --git a/ci/requirements/py36-min-nep18.yml b/ci/requirements/py36-min-nep18.yml index fc9523ce249..75ad2cd9205 100644 --- a/ci/requirements/py36-min-nep18.yml +++ b/ci/requirements/py36-min-nep18.yml @@ -15,4 +15,5 @@ dependencies: - pytest-cov - pytest-env - scipy=1.2 + - setuptools - sparse=0.8 diff --git a/ci/requirements/py36.yml b/ci/requirements/py36.yml index 820160b19cc..1a5855fd913 100644 --- a/ci/requirements/py36.yml +++ b/ci/requirements/py36.yml @@ -38,6 +38,7 @@ dependencies: - rasterio - scipy - seaborn + - setuptools - sparse - toolz - zarr diff --git a/ci/requirements/py37-windows.yml b/ci/requirements/py37-windows.yml index 614a3bb1fab..76375381094 100644 --- a/ci/requirements/py37-windows.yml +++ b/ci/requirements/py37-windows.yml @@ -38,6 +38,7 @@ dependencies: - rasterio - scipy - seaborn + - setuptools - sparse - toolz - zarr diff --git a/ci/requirements/py37.yml b/ci/requirements/py37.yml index 4a7aaf7d32b..c6929f39e17 100644 --- a/ci/requirements/py37.yml +++ b/ci/requirements/py37.yml @@ -38,6 +38,7 @@ dependencies: - rasterio - scipy - seaborn + - setuptools - sparse - toolz - zarr diff --git a/ci/requirements/py38.yml b/ci/requirements/py38.yml index 9698e3efecf..d73d2397ce9 100644 --- a/ci/requirements/py38.yml +++ b/ci/requirements/py38.yml @@ -3,6 +3,7 @@ channels: - conda-forge dependencies: - python=3.8 + - setuptools - pip - pip: - coveralls diff --git a/setup.py b/setup.py index cba0c74aa3a..c3e29b5b541 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ ] PYTHON_REQUIRES = ">=3.6" -INSTALL_REQUIRES = ["numpy >= 1.14", "pandas >= 0.24"] +INSTALL_REQUIRES = ["numpy >= 1.14", "pandas >= 0.24", "setuptools"] needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv) SETUP_REQUIRES = ["pytest-runner >= 4.2"] if needs_pytest else [] TESTS_REQUIRE = ["pytest >= 2.7.1"] From f2cf7e7670524bd282b8cbb5d09964a2945b8f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Wed, 18 Dec 2019 07:58:24 +0100 Subject: [PATCH 2/5] PKG: Remove setuptools MONTHS policy --- ci/min_deps_check.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index 87f19ec773d..a5ba90679b7 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -22,8 +22,7 @@ "pytest-env", } -POLICY_MONTHS = {"python": 42, "numpy": 24, "pandas": 12, "scipy": 12, - "setuptools": 12} +POLICY_MONTHS = {"python": 42, "numpy": 24, "pandas": 12, "scipy": 12} POLICY_MONTHS_DEFAULT = 6 has_errors = False From c8a61976cf7daec67c997d0b8999e5ff11dc1868 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Thu, 30 Jan 2020 17:57:49 +0000 Subject: [PATCH 3/5] Code review --- .binder/environment.yml | 1 + doc/installing.rst | 1 + doc/whats-new.rst | 2 ++ setup.cfg | 5 ++++- xarray/__init__.py | 6 +++--- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.binder/environment.yml b/.binder/environment.yml index 13b6b99e6fc..b49b81efbc9 100644 --- a/.binder/environment.yml +++ b/.binder/environment.yml @@ -31,6 +31,7 @@ dependencies: - rasterio - scipy - seaborn + - setuptools - sparse - toolz - xarray diff --git a/doc/installing.rst b/doc/installing.rst index 5c39f9a3c49..1635c06d5db 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -7,6 +7,7 @@ Required dependencies --------------------- - Python (3.6 or later) +- setuptools - `numpy `__ (1.15 or later) - `pandas `__ (0.25 or later) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index f8ac959f0ad..003c60d8ef8 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -129,6 +129,8 @@ Bug fixes - Allow plotting of binned coordinates on the y axis in :py:meth:`plot.line` and :py:meth:`plot.step` plots (:issue:`3571`, :pull:`3685`) by `Julien Seguinot `_. +- setuptools is now marked as a dependency of xarray + (:pull:`3628`) by `Richard Höchenberger `_. Documentation ~~~~~~~~~~~~~ diff --git a/setup.cfg b/setup.cfg index e336f46e68c..e21599d4852 100644 --- a/setup.cfg +++ b/setup.cfg @@ -79,9 +79,12 @@ zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.htm include_package_data = True python_requires = >=3.6 install_requires = + setuptools # For pkg_resources numpy >= 1.15 pandas >= 0.25 -setup_requires = setuptools_scm +setup_requires = + setuptools + setuptools_scm [options.package_data] xarray = diff --git a/xarray/__init__.py b/xarray/__init__.py index 44dc66411c4..331d8ecb09a 100644 --- a/xarray/__init__.py +++ b/xarray/__init__.py @@ -1,3 +1,5 @@ +import pkg_resources + from . import testing, tutorial, ufuncs from .backends.api import ( load_dataarray, @@ -27,11 +29,9 @@ from .util.print_versions import show_versions try: - import pkg_resources - __version__ = pkg_resources.get_distribution("xarray").version except Exception: - # Local copy, not installed with setuptools, or setuptools is not available. + # Local copy or not installed with setuptools. # Disable minimum version checks on downstream libraries. __version__ = "999" From ffa6d4ede9dd163b481192b24bcc78d4ab274602 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Thu, 30 Jan 2020 18:03:46 +0000 Subject: [PATCH 4/5] Display setuptools in github dependency graph --- requirements.txt | 1 + setup.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 17de1e6f26a..58239cf2a4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ numpy >= 1.15 pandas >= 0.25 +setuptools diff --git a/setup.cfg b/setup.cfg index e21599d4852..0ea380c6322 100644 --- a/setup.cfg +++ b/setup.cfg @@ -79,9 +79,9 @@ zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.htm include_package_data = True python_requires = >=3.6 install_requires = - setuptools # For pkg_resources numpy >= 1.15 pandas >= 0.25 + setuptools # For pkg_resources setup_requires = setuptools setuptools_scm From 12fb049acb791da6adb37ba7cf90633e322d0900 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Thu, 30 Jan 2020 18:11:44 +0000 Subject: [PATCH 5/5] setuptools minimum version --- ci/requirements/py36-bare-minimum.yml | 2 +- ci/requirements/py36-min-all-deps.yml | 2 +- ci/requirements/py36-min-nep18.yml | 2 +- requirements.txt | 2 +- setup.cfg | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/requirements/py36-bare-minimum.yml b/ci/requirements/py36-bare-minimum.yml index 82040fcdb20..00fef672855 100644 --- a/ci/requirements/py36-bare-minimum.yml +++ b/ci/requirements/py36-bare-minimum.yml @@ -10,4 +10,4 @@ dependencies: - pytest-env - numpy=1.15 - pandas=0.25 - - setuptools + - setuptools=41.2 diff --git a/ci/requirements/py36-min-all-deps.yml b/ci/requirements/py36-min-all-deps.yml index f4a8ada38ee..2781e551f23 100644 --- a/ci/requirements/py36-min-all-deps.yml +++ b/ci/requirements/py36-min-all-deps.yml @@ -43,7 +43,7 @@ dependencies: - rasterio=1.0 - scipy=1.3 - seaborn=0.9 - - setuptools + - setuptools=41.2 # - sparse # See py36-min-nep18.yml - toolz=0.10 - zarr=2.3 diff --git a/ci/requirements/py36-min-nep18.yml b/ci/requirements/py36-min-nep18.yml index 1f44dfd6964..286b11c0de1 100644 --- a/ci/requirements/py36-min-nep18.yml +++ b/ci/requirements/py36-min-nep18.yml @@ -16,5 +16,5 @@ dependencies: - pytest-cov - pytest-env - scipy=1.2 - - setuptools + - setuptools=41.2 - sparse=0.8 diff --git a/requirements.txt b/requirements.txt index 58239cf2a4c..f73887ff5cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ numpy >= 1.15 pandas >= 0.25 -setuptools +setuptools >= 41.2 diff --git a/setup.cfg b/setup.cfg index 0ea380c6322..3ccb431786b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -81,9 +81,9 @@ python_requires = >=3.6 install_requires = numpy >= 1.15 pandas >= 0.25 - setuptools # For pkg_resources + setuptools >= 41.2 # For pkg_resources setup_requires = - setuptools + setuptools >= 41.2 setuptools_scm [options.package_data]