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

Skip to content

Introduce variable since which mpl version the minimal python version #18895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
# and/or pip.
import sys

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

if sys.version_info < min_version:
if sys.version_info < py_min_version:
error = """
Beginning with Matplotlib 3.4, Python {0} or above is required.
You are using Python {1}.
Beginning with Matplotlib {0}, Python {1} or above is required.
You are using Python {2}.

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 since_mpl_version),
'.'.join(str(n) for n in py_min_version),
'.'.join(str(n) for n in sys.version_info[:3]))
sys.exit(error)

Expand Down Expand Up @@ -281,7 +283,7 @@ def build_extensions(self):
ext_modules=[Extension("", [])],
package_data=package_data,

python_requires='>={}'.format('.'.join(str(n) for n in min_version)),
python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
setup_requires=[
"certifi>=2020.06.20",
"numpy>=1.16",
Expand Down