summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2017-12-01 14:35:07 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2017-12-15 09:12:38 +0100
commit78bc8f2e6163461ee15fec53c7d5e28a24507829 (patch)
tree557aaf0a3895940424c5413ed9fd31526614b006
parent629c92db2dc1b016f4bf47645c95c42e65fd3bd6 (diff)
downloadastroid-git-78bc8f2e6163461ee15fec53c7d5e28a24507829.tar.gz
Drop support for EOL Python 3.3
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml2
-rw-r--r--README.rst2
-rw-r--r--appveyor.yml3
-rw-r--r--astroid/__pkginfo__.py12
-rw-r--r--astroid/brain/brain_namedtuple_enum.py4
-rw-r--r--astroid/brain/brain_subprocess.py4
-rw-r--r--astroid/interpreter/_import/spec.py2
-rw-r--r--astroid/rebuilder.py7
-rw-r--r--astroid/tests/unittest_manager.py4
-rw-r--r--astroid/tests/unittest_python3.py32
-rw-r--r--setup.py1
-rw-r--r--tox.ini6
13 files changed, 33 insertions, 47 deletions
diff --git a/.gitignore b/.gitignore
index 28ed9047..69c9da7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ log
build
dist/
astroid.egg-info/
+.idea
.tox
.coverage
.coverage.*
diff --git a/.travis.yml b/.travis.yml
index 02515935..feddbafe 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,8 +4,6 @@ matrix:
include:
- python: 2.7
env: TOXENV=py27
- - python: 3.3
- env: TOXENV=py33
- python: 3.4
env: TOXENV=py34
- python: 3.5
diff --git a/README.rst b/README.rst
index 5e2f629c..7cd5571e 100644
--- a/README.rst
+++ b/README.rst
@@ -55,7 +55,7 @@ http://lists.logilab.org/mailman/listinfo/python-projects .
Python Versions
---------------
-astroid is compatible with Python 2.7 as well as 3.3 and later. astroid uses
+astroid is compatible with Python 2.7 as well as 3.4 and later. astroid uses
the same code base for both Python versions, using six.
Test
diff --git a/appveyor.yml b/appveyor.yml
index 999daa87..f8b96cbb 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -7,9 +7,6 @@ environment:
- PYTHON: "C:\\Python27"
TOXENV: "py27"
- - PYTHON: "C:\\Python33"
- TOXENV: "py33"
-
- PYTHON: "C:\\Python34"
TOXENV: "py34"
diff --git a/astroid/__pkginfo__.py b/astroid/__pkginfo__.py
index 5ea12a4a..1aa41dbd 100644
--- a/astroid/__pkginfo__.py
+++ b/astroid/__pkginfo__.py
@@ -34,13 +34,14 @@ def has_environment_marker_range_operators_support():
if has_environment_marker_range_operators_support():
- extras_require[':python_version<"3.4"'] = ['enum34>=1.1.3', 'singledispatch']
- extras_require[':python_version<"3.3"'] = ['backports.functools_lru_cache']
+ extras_require[':python_version<"3.4"'] = ['enum34>=1.1.3',
+ 'singledispatch',
+ 'backports.functools_lru_cache']
else:
if py_version < (3, 4):
- install_requires.extend(['enum34', 'singledispatch'])
- if py_version < (3, 3):
- install_requires.append('backports.functools_lru_cache')
+ install_requires.extend(['enum34',
+ 'singledispatch',
+ 'backports.functools_lru_cache'])
# pylint: disable=redefined-builtin; why license is a builtin anyway?
@@ -59,7 +60,6 @@ classifiers = ["Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
diff --git a/astroid/brain/brain_namedtuple_enum.py b/astroid/brain/brain_namedtuple_enum.py
index 519a75f4..765c3202 100644
--- a/astroid/brain/brain_namedtuple_enum.py
+++ b/astroid/brain/brain_namedtuple_enum.py
@@ -20,10 +20,6 @@ from astroid import nodes
from astroid.builder import AstroidBuilder, extract_node
from astroid import util
-PY3K = sys.version_info > (3, 0)
-PY33 = sys.version_info >= (3, 3)
-PY34 = sys.version_info >= (3, 4)
-
def _infer_first(node, context):
if node is util.Uninferable:
diff --git a/astroid/brain/brain_subprocess.py b/astroid/brain/brain_subprocess.py
index db800e78..79dc1b93 100644
--- a/astroid/brain/brain_subprocess.py
+++ b/astroid/brain/brain_subprocess.py
@@ -11,7 +11,7 @@ import six
import astroid
-PY33 = sys.version_info >= (3, 3)
+PY34 = sys.version_info >= (3, 4)
PY36 = sys.version_info >= (3, 6)
@@ -51,7 +51,7 @@ def _subprocess_transform():
startupinfo=None, creationflags=0):
pass
"""
- if PY33:
+ if PY34:
wait_signature = 'def wait(self, timeout=None)'
else:
wait_signature = 'def wait(self)'
diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py
index 33302300..395ef8df 100644
--- a/astroid/interpreter/_import/spec.py
+++ b/astroid/interpreter/_import/spec.py
@@ -178,7 +178,7 @@ _SPEC_FINDERS = (
ImpFinder,
ZipFinder,
)
-if _HAS_MACHINERY and sys.version_info[:2] > (3, 3):
+if _HAS_MACHINERY and sys.version_info[:2] > (3, 4):
_SPEC_FINDERS += (PathSpecFinder, )
_SPEC_FINDERS += (ExplicitNamespacePackageFinder, )
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py
index e40eb7bb..7ff62157 100644
--- a/astroid/rebuilder.py
+++ b/astroid/rebuilder.py
@@ -163,19 +163,12 @@ class TreeRebuilder(object):
varargannotation = self.visit(node.vararg.annotation,
newnode)
vararg = vararg.arg
- elif PY3 and node.varargannotation:
- varargannotation = self.visit(node.varargannotation,
- newnode)
if kwarg:
if PY34:
if node.kwarg.annotation:
kwargannotation = self.visit(node.kwarg.annotation,
newnode)
kwarg = kwarg.arg
- elif PY3:
- if node.kwargannotation:
- kwargannotation = self.visit(node.kwargannotation,
- newnode)
if PY3:
kwonlyargs = [self.visit(child, newnode) for child
in node.kwonlyargs]
diff --git a/astroid/tests/unittest_manager.py b/astroid/tests/unittest_manager.py
index f3967e28..dd024af8 100644
--- a/astroid/tests/unittest_manager.py
+++ b/astroid/tests/unittest_manager.py
@@ -26,7 +26,7 @@ BUILTINS = six.moves.builtins.__name__
def _get_file_from_object(obj):
if platform.python_implementation() == 'Jython':
return obj.__file__.split("$py.class")[0] + ".py"
- if sys.version_info > (3, 0):
+ if sys.version_info > (3, 4):
return obj.__file__
if not obj.__file__.endswith(".py"):
return obj.__file__[:-1]
@@ -104,7 +104,7 @@ class AstroidManagerTest(resources.SysPathSetup,
def test_ast_from_namespace_pkg_resources(self):
self._test_ast_from_old_namespace_package_protocol('pkg_resources')
- @unittest.skipUnless(sys.version_info[:2] > (3, 3), "Needs PEP 420 namespace protocol")
+ @unittest.skipUnless(sys.version_info[:2] > (3, 4), "Needs PEP 420 namespace protocol")
def test_implicit_namespace_package(self):
data_dir = os.path.dirname(resources.find('data/namespace_pep_420'))
contribute = os.path.join(data_dir, 'contribute_to_namespace')
diff --git a/astroid/tests/unittest_python3.py b/astroid/tests/unittest_python3.py
index bbf0491f..5bdc5eb5 100644
--- a/astroid/tests/unittest_python3.py
+++ b/astroid/tests/unittest_python3.py
@@ -20,7 +20,7 @@ class Python3TC(unittest.TestCase):
def setUpClass(cls):
cls.builder = AstroidBuilder()
- @require_version('3.0')
+ @require_version('3.4')
def test_starred_notation(self):
astroid = self.builder.string_build("*a, b = [1, 2, 3]", 'test', 'test')
@@ -29,7 +29,7 @@ class Python3TC(unittest.TestCase):
self.assertTrue(isinstance(node.assign_type(), Assign))
- @require_version('3.3')
+ @require_version('3.4')
def test_yield_from(self):
body = dedent("""
def func():
@@ -45,7 +45,7 @@ class Python3TC(unittest.TestCase):
self.assertEqual(yieldfrom_stmt.as_string(),
'yield from iter([1, 2])')
- @require_version('3.3')
+ @require_version('3.4')
def test_yield_from_is_generator(self):
body = dedent("""
def func():
@@ -56,7 +56,7 @@ class Python3TC(unittest.TestCase):
self.assertIsInstance(func, FunctionDef)
self.assertTrue(func.is_generator())
- @require_version('3.3')
+ @require_version('3.4')
def test_yield_from_as_string(self):
body = dedent("""
def func():
@@ -69,7 +69,7 @@ class Python3TC(unittest.TestCase):
# metaclass tests
- @require_version('3.0')
+ @require_version('3.4')
def test_simple_metaclass(self):
astroid = self.builder.string_build("class Test(metaclass=type): pass")
klass = astroid.body[0]
@@ -78,13 +78,13 @@ class Python3TC(unittest.TestCase):
self.assertIsInstance(metaclass, ClassDef)
self.assertEqual(metaclass.name, 'type')
- @require_version('3.0')
+ @require_version('3.4')
def test_metaclass_error(self):
astroid = self.builder.string_build("class Test(metaclass=typ): pass")
klass = astroid.body[0]
self.assertFalse(klass.metaclass())
- @require_version('3.0')
+ @require_version('3.4')
def test_metaclass_imported(self):
astroid = self.builder.string_build(dedent("""
from abc import ABCMeta
@@ -95,7 +95,7 @@ class Python3TC(unittest.TestCase):
self.assertIsInstance(metaclass, ClassDef)
self.assertEqual(metaclass.name, 'ABCMeta')
- @require_version('3.0')
+ @require_version('3.4')
def test_metaclass_multiple_keywords(self):
astroid = self.builder.string_build("class Test(magic=None, metaclass=type): pass")
klass = astroid.body[0]
@@ -104,7 +104,7 @@ class Python3TC(unittest.TestCase):
self.assertIsInstance(metaclass, ClassDef)
self.assertEqual(metaclass.name, 'type')
- @require_version('3.0')
+ @require_version('3.4')
def test_as_string(self):
body = dedent("""
from abc import ABCMeta
@@ -115,7 +115,7 @@ class Python3TC(unittest.TestCase):
self.assertEqual(klass.as_string(),
'\n\nclass Test(metaclass=ABCMeta):\n pass\n')
- @require_version('3.0')
+ @require_version('3.4')
def test_old_syntax_works(self):
astroid = self.builder.string_build(dedent("""
class Test:
@@ -126,7 +126,7 @@ class Python3TC(unittest.TestCase):
metaclass = klass.metaclass()
self.assertIsNone(metaclass)
- @require_version('3.0')
+ @require_version('3.4')
def test_metaclass_yes_leak(self):
astroid = self.builder.string_build(dedent("""
# notice `ab` instead of `abc`
@@ -137,7 +137,7 @@ class Python3TC(unittest.TestCase):
klass = astroid['Meta']
self.assertIsNone(klass.metaclass())
- @require_version('3.0')
+ @require_version('3.4')
def test_parent_metaclass(self):
astroid = self.builder.string_build(dedent("""
from abc import ABCMeta
@@ -150,7 +150,7 @@ class Python3TC(unittest.TestCase):
self.assertIsInstance(metaclass, ClassDef)
self.assertEqual(metaclass.name, 'ABCMeta')
- @require_version('3.0')
+ @require_version('3.4')
def test_metaclass_ancestors(self):
astroid = self.builder.string_build(dedent("""
from abc import ABCMeta
@@ -178,7 +178,7 @@ class Python3TC(unittest.TestCase):
self.assertIsInstance(meta, ClassDef)
self.assertEqual(meta.name, metaclass)
- @require_version('3.0')
+ @require_version('3.4')
def test_annotation_support(self):
astroid = self.builder.string_build(dedent("""
def test(a: int, b: str, c: None, d, e,
@@ -213,7 +213,7 @@ class Python3TC(unittest.TestCase):
self.assertEqual(func.args.annotations[1].name, 'str')
self.assertIsNone(func.returns)
- @require_version('3.0')
+ @require_version('3.4')
def test_kwonlyargs_annotations_supper(self):
node = self.builder.string_build(dedent("""
def test(*, a: int, b: str, c: None, d, e):
@@ -230,7 +230,7 @@ class Python3TC(unittest.TestCase):
self.assertIsNone(arguments.kwonlyargs_annotations[3])
self.assertIsNone(arguments.kwonlyargs_annotations[4])
- @require_version('3.0')
+ @require_version('3.4')
def test_annotation_as_string(self):
code1 = dedent('''
def test(a, b:int=4, c=2, f:'lala'=4)->2:
diff --git a/setup.py b/setup.py
index d6e7fe6d..d875fb9d 100644
--- a/setup.py
+++ b/setup.py
@@ -52,6 +52,7 @@ def install():
author_email = author_email,
url = web,
include_package_data = True,
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
install_requires = install_requires,
extras_require=extras_require,
packages = find_packages(),
diff --git a/tox.ini b/tox.ini
index d0f35fbb..b084583b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27, py33, py34, py35, py36, pypy, pylint
+envlist = py27, py34, py35, py36, pypy, pylint
skip_missing_interpreters = true
[testenv:pylint]
@@ -8,14 +8,14 @@ commands = pylint -rn --rcfile={toxinidir}/pylintrc {toxinidir}/astroid
[testenv]
deps =
py27,pypy: backports.functools_lru_cache
- py27,py33,pypy: enum34
+ py27,pypy: enum34
lazy-object-proxy
nose
py27,py34,py35,py36: numpy
py27,py34,py35,py36: attr
pytest
python-dateutil
- py27,py33,pypy: singledispatch
+ py27,pypy: singledispatch
six
wrapt
pylint: git+https://github.com/pycqa/pylint@master