From 13ee932f2503e0934eeffea60242b4916800952c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 8 Apr 2020 17:11:32 -0400 Subject: [PATCH 1/2] Remove new Python syntax from setup.py. We cannot yet rely on pip to be new enough to recognize out python_requires, and we get several reports of broken syntax on older Python. --- setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 2548d4f82d66..de058e9f943f 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ This may be due to an out of date pip. Make sure you have pip >= 9.0.1. -""".format('.'.join(str(n) for n in min_version)), +""".format('.'.join(str(n) for n in min_version)) sys.exit(error) from pathlib import Path @@ -112,8 +112,9 @@ def _download_jquery_to(dest): try: buff = download_or_cache(url, sha) except Exception: - raise IOError(f"Failed to download jquery-ui. Please download " - f"{url} and extract it to {dest}.") + raise IOError( + "Failed to download jquery-ui. Please download " + "{url} and extract it to {dest}.".format(url=url, dest=dest)) with ZipFile(buff) as zf: zf.extractall(dest) @@ -154,7 +155,7 @@ def run(self): # If the user just queries for information, don't bother figuring out which # packages to build or install. if not (any('--' + opt in sys.argv - for opt in [*Distribution.display_option_names, 'help']) + for opt in Distribution.display_option_names + ['help']) or 'clean' in sys.argv): # Go through all of the packages and figure out which ones we are # going to build/install. @@ -169,10 +170,11 @@ def run(self): try: message = package.check() except setupext.Skipped as e: - print_status(package.name, f"no [{e}]") + print_status(package.name, "no [{e}]".format(e=e)) continue if message is not None: - print_status(package.name, f"yes [{message}]") + print_status(package.name, + "yes [{message}]".format(message=message)) good_packages.append(package) print_raw() From dabc706c44efa41bf2672d6b391cf70d3336c2bb Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 8 Apr 2020 17:12:25 -0400 Subject: [PATCH 2/2] Add current Python version in setup.py error message. --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index de058e9f943f..d4daedd739f3 100644 --- a/setup.py +++ b/setup.py @@ -13,11 +13,13 @@ if sys.version_info < min_version: error = """ Beginning with Matplotlib 3.1, Python {0} or above is required. +You are using Python {1}. This may be due to an out of date pip. Make sure you have pip >= 9.0.1. -""".format('.'.join(str(n) for n in min_version)) +""".format('.'.join(str(n) for n in min_version), + '.'.join(str(n) for n in sys.version_info[:3])) sys.exit(error) from pathlib import Path