From 56f60e39c4d7cd1969697537d39fecf5566609c6 Mon Sep 17 00:00:00 2001 From: Brigitta Sipocz Date: Mon, 24 Jun 2019 21:07:31 -0700 Subject: [PATCH 1/3] Updated astropy-helpers to v3.2.1 --- ah_bootstrap.py | 51 ++++++++++++++++++------------------------------- astropy_helpers | 2 +- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/ah_bootstrap.py b/ah_bootstrap.py index 86db377b..512a05a1 100644 --- a/ah_bootstrap.py +++ b/ah_bootstrap.py @@ -48,11 +48,7 @@ from distutils import log from distutils.debug import DEBUG - -try: - from ConfigParser import ConfigParser, RawConfigParser -except ImportError: - from configparser import ConfigParser, RawConfigParser +from configparser import ConfigParser, RawConfigParser import pkg_resources @@ -60,25 +56,12 @@ from setuptools.package_index import PackageIndex # This is the minimum Python version required for astropy-helpers -__minimum_python_version__ = (2, 7) - -if sys.version_info[0] < 3: - _str_types = (str, unicode) - _text_type = unicode - PY3 = False -else: - _str_types = (str, bytes) - _text_type = str - PY3 = True +__minimum_python_version__ = (3, 5) # TODO: Maybe enable checking for a specific version of astropy_helpers? DIST_NAME = 'astropy-helpers' PACKAGE_NAME = 'astropy_helpers' - -if PY3: - UPPER_VERSION_EXCLUSIVE = None -else: - UPPER_VERSION_EXCLUSIVE = '3' +UPPER_VERSION_EXCLUSIVE = None # Defaults for other options DOWNLOAD_IF_NEEDED = True @@ -138,35 +121,39 @@ # allow pre-releases to count as 'new enough' if not req.specifier.contains(python_version, True): if parent_package is None: - print("ERROR: Python {} is required by this package".format(req.specifier)) + message = "ERROR: Python {} is required by this package\n".format(req.specifier) else: - print("ERROR: Python {} is required by {}".format(req.specifier, parent_package)) + message = "ERROR: Python {} is required by {}\n".format(req.specifier, parent_package) + sys.stderr.write(message) sys.exit(1) if sys.version_info < __minimum_python_version__: if parent_package is None: - print("ERROR: Python {} or later is required by astropy-helpers".format( - __minimum_python_version__)) + message = "ERROR: Python {} or later is required by astropy-helpers\n".format( + __minimum_python_version__) else: - print("ERROR: Python {} or later is required by astropy-helpers for {}".format( - __minimum_python_version__, parent_package)) + message = "ERROR: Python {} or later is required by astropy-helpers for {}\n".format( + __minimum_python_version__, parent_package) + sys.stderr.write(message) sys.exit(1) +_str_types = (str, bytes) + # What follows are several import statements meant to deal with install-time # issues with either missing or misbehaving pacakges (including making sure # setuptools itself is installed): -# Check that setuptools 1.0 or later is present +# Check that setuptools 30.3 or later is present from distutils.version import LooseVersion try: import setuptools - assert LooseVersion(setuptools.__version__) >= LooseVersion('1.0') + assert LooseVersion(setuptools.__version__) >= LooseVersion('30.3') except (ImportError, AssertionError): - print("ERROR: setuptools 1.0 or later is required by astropy-helpers") + sys.stderr.write("ERROR: setuptools 30.3 or later is required by astropy-helpers\n") sys.exit(1) # typing as a dependency for 1.6.1+ Sphinx causes issues when imported after @@ -225,7 +212,7 @@ def __init__(self, path=None, index_url=None, use_git=None, offline=None, if not (isinstance(path, _str_types) or path is False): raise TypeError('path must be a string or False') - if PY3 and not isinstance(path, _text_type): + if not isinstance(path, str): fs_encoding = sys.getfilesystemencoding() path = path.decode(fs_encoding) # path to unicode @@ -852,9 +839,9 @@ def run_cmd(cmd): stdio_encoding = 'latin1' # Unlikely to fail at this point but even then let's be flexible - if not isinstance(stdout, _text_type): + if not isinstance(stdout, str): stdout = stdout.decode(stdio_encoding, 'replace') - if not isinstance(stderr, _text_type): + if not isinstance(stderr, str): stderr = stderr.decode(stdio_encoding, 'replace') return (p.returncode, stdout, stderr) diff --git a/astropy_helpers b/astropy_helpers index fd80be7c..ba373422 160000 --- a/astropy_helpers +++ b/astropy_helpers @@ -1 +1 @@ -Subproject commit fd80be7cf8698e2350a919ef7fc89871db0ba580 +Subproject commit ba3734222a40f4c2864c375c6639f32cd9df06cd From 9741c1ecb0e7668ec842b10fdb4f298219b3ec40 Mon Sep 17 00:00:00 2001 From: Brigitta Sipocz Date: Mon, 1 Jul 2019 17:06:41 -0700 Subject: [PATCH 2/3] Remove python2 testing --- appveyor.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 37b3c507..ee102de2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,14 +19,6 @@ environment: MPLBACKEND: "Agg" matrix: - - # We test Python 2.7 and 3.7 because 2.7 is the supported Python 2 - # release of Astropy and Python 3.7 is the latest Python 3 release. - - - PYTHON_VERSION: "2.7" - ASTROPY_VERSION: "stable" - NUMPY_VERSION: "1.15" - - PYTHON_VERSION: "3.7" ASTROPY_VERSION: "stable" NUMPY_VERSION: "stable" From 9dcf2082487225e042bc770e1fa00674cd51887d Mon Sep 17 00:00:00 2001 From: Brigitta Sipocz Date: Mon, 1 Jul 2019 17:06:48 -0700 Subject: [PATCH 3/3] Adding docs dependency --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4c1ba07a..fbca3943 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,7 @@ matrix: - env: PYTHON_VERSION=3.6 SETUP_CMD='build_docs -w' CONDA_CHANNELS='conda-forge astropy' + PIP_DEPENDENCIES='sphinx-astropy' # Do a test without the optional dependencies - env: SETUP_CMD='test'