Skip to content

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 2 commits into from
Oct 21, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Remove checks for Python 3.x, x < 4.
The requirement is 2.7 or 3.4+.
  • Loading branch information
QuLogic committed Oct 21, 2016
commit 6d6098a1e1be58b067a9dfa8006e43f45b5ea225
2 changes: 1 addition & 1 deletion lib/matplotlib/compat/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from __future__ import print_function
import os
import sys
if os.name == 'posix' and sys.version_info[:2] < (3, 2):
if os.name == 'posix' and sys.version_info[0] < 3:
# work around for https://github.com/matplotlib/matplotlib/issues/5314
try:
import subprocess32 as subprocess
Expand Down
31 changes: 11 additions & 20 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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()
Copy link
Member

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?

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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__
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not six.moves.urllib.request.urlretrieve?


if not os.path.exists('build'):
os.makedirs('build')

Expand Down Expand Up @@ -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 "
Expand All @@ -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:
Expand All @@ -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 []
Expand All @@ -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:
Expand All @@ -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 []
Expand Down