-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Drop old Python checks #7316
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
Drop old Python checks #7316
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
|
||
|
||
PY3min = (sys.version_info[0] >= 3) | ||
PY32min = (PY3min and sys.version_info[1] >= 2 or sys.version_info[0] > 3) | ||
|
||
|
||
def _get_home(): | ||
|
@@ -90,7 +89,7 @@ def _get_xdg_cache_dir(): | |
|
||
setup_cfg = os.environ.get('MPLSETUPCFG', 'setup.cfg') | ||
if os.path.exists(setup_cfg): | ||
if PY32min: | ||
if PY3min: | ||
config = configparser.ConfigParser() | ||
else: | ||
config = configparser.SafeConfigParser() | ||
|
@@ -724,7 +723,7 @@ def check(self): | |
except ImportError: | ||
msgs += [bad_nose] | ||
|
||
if sys.version_info >= (3, 3): | ||
if PY3min: | ||
msgs += ['using unittest.mock'] | ||
else: | ||
try: | ||
|
@@ -849,7 +848,7 @@ class Numpy(SetupPackage): | |
|
||
@staticmethod | ||
def include_dirs_hook(): | ||
if sys.version_info[0] >= 3: | ||
if PY3min: | ||
import builtins | ||
if hasattr(builtins, '__NUMPY_SETUP__'): | ||
del builtins.__NUMPY_SETUP__ | ||
|
@@ -1047,11 +1046,11 @@ def do_custom_build(self): | |
pass | ||
|
||
if not os.path.isfile(tarball_path): | ||
|
||
if sys.version_info[0] == 2: | ||
from urllib import urlretrieve | ||
else: | ||
if PY3min: | ||
from urllib.request import urlretrieve | ||
else: | ||
from urllib import urlretrieve | ||
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. Why not |
||
|
||
if not os.path.exists('build'): | ||
os.makedirs('build') | ||
|
||
|
@@ -1370,14 +1369,6 @@ def check(self): | |
try: | ||
import dateutil | ||
except ImportError: | ||
# dateutil 2.1 has a file encoding bug that breaks installation on | ||
# python 3.3 | ||
# https://github.com/matplotlib/matplotlib/issues/2373 | ||
# hack around the problem by installing the (working) v2.0 | ||
major, minor1, _, _, _ = sys.version_info | ||
if self.version is None and (major, minor1) == (3, 3): | ||
self.version = '!=2.1' | ||
|
||
return ( | ||
"dateutil was not found. It is required for date axis " | ||
"support. pip/easy_install may attempt to install it " | ||
|
@@ -1396,7 +1387,7 @@ class FuncTools32(SetupPackage): | |
name = "functools32" | ||
|
||
def check(self): | ||
if sys.version_info[:2] < (3, 2): | ||
if not PY3min: | ||
try: | ||
import functools32 | ||
except ImportError: | ||
|
@@ -1409,7 +1400,7 @@ def check(self): | |
return "Not required" | ||
|
||
def get_install_requires(self): | ||
if sys.version_info[:2] < (3, 2): | ||
if not PY3min: | ||
return ['functools32'] | ||
else: | ||
return [] | ||
|
@@ -1419,7 +1410,7 @@ class Subprocess32(SetupPackage): | |
name = "subprocess32" | ||
|
||
def check(self): | ||
if sys.version_info[:2] < (3, 2): | ||
if not PY3min: | ||
try: | ||
import subprocess32 | ||
except ImportError: | ||
|
@@ -1433,7 +1424,7 @@ def check(self): | |
return "Not required" | ||
|
||
def get_install_requires(self): | ||
if sys.version_info[:2] < (3, 2) and os.name == 'posix': | ||
if not PY3min and os.name == 'posix': | ||
return ['subprocess32'] | ||
else: | ||
return [] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not
six.moves.configparser.SafeConfigParser
?