Skip to content

Commit f9907b4

Browse files
committedNov 4, 2020
Introduce variable since which mpl version the minimal python version
requirement holds. By introducing a variable instead of a hard-coded value in the error message, I hope that we remember to update `since_mpl_version` when we update `py_min_version`.
1 parent 07145c2 commit f9907b4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎setup.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@
88
# and/or pip.
99
import sys
1010

11-
min_version = (3, 7)
11+
py_min_version = (3, 7) # minimal supported python version
12+
since_mpl_version = (3, 4) # py_min_version is required since this mpl version
1213

13-
if sys.version_info < min_version:
14+
if sys.version_info < py_min_version:
1415
error = """
15-
Beginning with Matplotlib 3.4, Python {0} or above is required.
16-
You are using Python {1}.
16+
Beginning with Matplotlib {0}, Python {1} or above is required.
17+
You are using Python {2}.
1718
1819
This may be due to an out of date pip.
1920
2021
Make sure you have pip >= 9.0.1.
21-
""".format('.'.join(str(n) for n in min_version),
22+
""".format('.'.join(str(n) for n in since_mpl_version),
23+
'.'.join(str(n) for n in py_min_version),
2224
'.'.join(str(n) for n in sys.version_info[:3]))
2325
sys.exit(error)
2426

@@ -281,7 +283,7 @@ def build_extensions(self):
281283
ext_modules=[Extension("", [])],
282284
package_data=package_data,
283285

284-
python_requires='>={}'.format('.'.join(str(n) for n in min_version)),
286+
python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
285287
setup_requires=[
286288
"certifi>=2020.06.20",
287289
"numpy>=1.16",

0 commit comments

Comments
 (0)
Please sign in to comment.