-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove Python 2 code from setup #10470
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,18 @@ | |
|
||
import six | ||
|
||
import sys | ||
if sys.version_info < (3, 5): # noqa: E402 | ||
raise ImportError(""" | ||
Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4. | ||
Beginning with Matplotlib 3.0, Python 3.5 and above is required. | ||
|
||
See Matplotlib `INSTALL.rst` file for more information: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For more information see https://github.com/matplotlib/matplotlib/blob/master/INSTALL.rst There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't fit on a line nicely. |
||
|
||
https://github.com/matplotlib/matplotlib/blob/master/INSTALL.rst | ||
|
||
""") | ||
|
||
import atexit | ||
from collections import MutableMapping | ||
import contextlib | ||
|
@@ -121,21 +133,9 @@ | |
import re | ||
import shutil | ||
import stat | ||
import sys | ||
import tempfile | ||
import warnings | ||
|
||
if sys.version_info < (3, 5): # noqa: E402 | ||
raise ImportError(""" | ||
Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4. | ||
Beginning with Matplotlib 3.0, Python 3.5 and above is required. | ||
|
||
See Matplotlib `INSTALL.rst` file for more information: | ||
|
||
https://github.com/matplotlib/matplotlib/blob/master/INSTALL.rst | ||
|
||
""") | ||
|
||
# cbook must import matplotlib only within function | ||
# definitions, so it is safe to import from it here. | ||
from . import cbook | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,17 @@ | |
|
||
import sys | ||
|
||
if sys.version_info < (3, 5): | ||
error = """ | ||
Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. |
||
Beginning with Matplotlib 3.0, Python 3.5 and above is required. | ||
|
||
This may be due to an out of date pip. | ||
|
||
Make sure you have pip >= 9.0.1. | ||
""" | ||
sys.exit(error) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this behave if installed as a dependency of something via pip? Modern pip should never try, but what do old versions of pip do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, that's why we error out and the message suggests that you install a new pip. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a normal install, it does this:
I'm not sure how to test it out as a dependency, but I'd guess you get a similar error. |
||
|
||
# distutils is breaking our sdists for files in symlinked dirs. | ||
# distutils will copy if os.link is not available, so this is a hack | ||
# to force copying | ||
|
@@ -108,9 +119,7 @@ | |
'Intended Audience :: Science/Research', | ||
'License :: OSI Approved :: Python Software Foundation License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Topic :: Scientific/Engineering :: Visualization', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both lines -> "Matplotlib 3.0+ requires Python 3.5 or above."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as before and it's being explicit on purpose, as it's following IPython's lead.