Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1ebdf2

Browse files
committed
BLD: parameterize python_requires
Only write the minimum version 1 place instead of 3
1 parent 5640afd commit e1ebdf2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
from setuptools.command.test import test as TestCommand
1212
from setuptools.command.build_ext import build_ext as BuildExtCommand
1313

14-
if sys.version_info < (3, 6):
14+
min_version = (3, 6)
15+
16+
if sys.version_info < min_version:
1517
error = """
16-
Beginning with Matplotlib 3.1, Python 3.6 or above is required.
18+
Beginning with Matplotlib 3.1, Python {} or above is required.
1719
1820
This may be due to an out of date pip.
1921
2022
Make sure you have pip >= 9.0.1.
21-
"""
23+
""".format('.'.join(str(n) for n in min_version)),
2224
sys.exit(error)
2325

2426
# The setuptools version of sdist adds a setup.cfg file to the tree.
@@ -230,7 +232,7 @@ def build_extensions(self):
230232
classifiers=classifiers,
231233
download_url="http://matplotlib.org/users/installing.html",
232234

233-
python_requires='>=3.6',
235+
python_requires='>={}'.format('.'.join(str(n) for n in min_version)),
234236
# List third-party Python packages that we require
235237
install_requires=install_requires,
236238
setup_requires=setup_requires,

0 commit comments

Comments
 (0)