From 88366b393ce1501ac73351239838fd5fa708c115 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 9 Oct 2017 16:35:33 +0200 Subject: [PATCH 1/3] start the removal of python 2.6/3.3 support --- changelog/2812.removal | 1 + setup.py | 17 +++++++++-------- tox.ini | 12 ++---------- 3 files changed, 12 insertions(+), 18 deletions(-) create mode 100644 changelog/2812.removal diff --git a/changelog/2812.removal b/changelog/2812.removal new file mode 100644 index 000000000..c619ee2da --- /dev/null +++ b/changelog/2812.removal @@ -0,0 +1 @@ +remove support for the eol python versions 2.6 and 3.3 \ No newline at end of file diff --git a/setup.py b/setup.py index 4d74e6bca..b58a4014c 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ classifiers = [ 'Topic :: Utilities', ] + [ ('Programming Language :: Python :: %s' % x) - for x in '2 2.6 2.7 3 3.3 3.4 3.5 3.6'.split() + for x in '2.7 3 3.4 3.5 3.6'.split() ] with open('README.rst') as fd: @@ -50,12 +50,8 @@ def main(): install_requires.append('pluggy>=0.4.0,<0.5') extras_require = {} if has_environment_marker_support(): - extras_require[':python_version=="2.6"'] = ['argparse', 'ordereddict'] extras_require[':sys_platform=="win32"'] = ['colorama'] else: - if sys.version_info < (2, 7): - install_requires.append('argparse') - install_requires.append('ordereddict') if sys.platform == 'win32': install_requires.append('colorama') @@ -69,9 +65,11 @@ def main(): url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], - author='Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others', - entry_points={'console_scripts': - ['pytest=pytest:main', 'py.test=pytest:main']}, + author=( + 'Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, ' + 'Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others'), + entry_points={'console_scripts': [ + 'pytest=pytest:main', 'py.test=pytest:main']}, classifiers=classifiers, keywords="test unittest", cmdclass={'test': PyTest}, @@ -87,10 +85,13 @@ def main(): class PyTest(Command): user_options = [] + def initialize_options(self): pass + def finalize_options(self): pass + def run(self): import subprocess PPATH = [x for x in os.environ.get('PYTHONPATH', '').split(':') if x] diff --git a/tox.ini b/tox.ini index f6dfe82f4..0f9611e7d 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ distshare = {homedir}/.tox/distshare # make sure to update environment list in travis.yml and appveyor.yml envlist = linting - py26 py27 py33 py34 @@ -27,13 +26,6 @@ deps = mock requests -[testenv:py26] -# pinning mock to last supported version for python 2.6 -deps = - hypothesis<3.0 - nose - mock<1.1 - [testenv:py27-subprocess] changedir = . deps = @@ -54,7 +46,7 @@ deps = pygments restructuredtext_lint commands = - flake8 pytest.py _pytest testing + flake8 pytest.py _pytest testing setup.py pytest.py {envpython} scripts/check-rst.py [testenv:py27-xdist] @@ -174,7 +166,7 @@ usedevelop = True deps = autopep8 commands = - autopep8 --in-place -r --max-line-length=120 --exclude=test_source_multiline_block.py _pytest testing + autopep8 --in-place -r --max-line-length=120 --exclude=test_source_multiline_block.py _pytest testing setup.py pytest.py [testenv:jython] changedir = testing From 73ff53c742de501d0f3b4c4d6e3cdaa6a8b5fde5 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 9 Oct 2017 16:36:41 +0200 Subject: [PATCH 2/3] remove eol python from the ci config --- .travis.yml | 4 ---- appveyor.yml | 2 -- tox.ini | 1 - 3 files changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21fb6c7db..938391cde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,10 +31,6 @@ env: matrix: include: - - env: TOXENV=py26 - python: '2.6' - - env: TOXENV=py33 - python: '3.3' - env: TOXENV=pypy python: 'pypy-5.4' - env: TOXENV=py35 diff --git a/appveyor.yml b/appveyor.yml index 01a723d5f..4f4afe15c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,9 +10,7 @@ environment: - TOXENV: "coveralls" # note: please use "tox --listenvs" to populate the build matrix below - TOXENV: "linting" - - TOXENV: "py26" - TOXENV: "py27" - - TOXENV: "py33" - TOXENV: "py34" - TOXENV: "py35" - TOXENV: "py36" diff --git a/tox.ini b/tox.ini index 0f9611e7d..b774cbda5 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,6 @@ distshare = {homedir}/.tox/distshare envlist = linting py27 - py33 py34 py35 py36 From c48659844060746789f059929ce03a60589cc22b Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 9 Oct 2017 16:52:31 +0200 Subject: [PATCH 3/3] remove some support code for old python versions --- _pytest/compat.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/_pytest/compat.py b/_pytest/compat.py index 7bf3bb9b8..99ec54c53 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -4,7 +4,6 @@ python version compatibility code from __future__ import absolute_import, division, print_function import sys import inspect -import types import re import functools import codecs @@ -120,16 +119,6 @@ def getfuncargnames(function, startindex=None, cls=None): return tuple(argnames[startindex:]) -if sys.version_info[:2] == (2, 6): - def isclass(object): - """ Return true if the object is a class. Overrides inspect.isclass for - python 2.6 because it will return True for objects which always return - something on __getattr__ calls (see #1035). - Backport of https://hg.python.org/cpython/rev/35bf8f7a8edc - """ - return isinstance(object, (type, types.ClassType)) - - if _PY3: imap = map izip = zip @@ -230,10 +219,7 @@ def getimfunc(func): try: return func.__func__ except AttributeError: - try: - return func.im_func - except AttributeError: - return func + return func def safe_getattr(object, name, default):