Skip to content
This repository was archived by the owner on Nov 8, 2020. It is now read-only.

Commit 16cacd5

Browse files
committed
Drop deprecated python support (2.6, 2.7 and 3.4)
1 parent f41c854 commit 16cacd5

File tree

8 files changed

+18
-88
lines changed

8 files changed

+18
-88
lines changed

.travis.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
language: python
22
sudo: false
3-
dist: trusty
3+
dist: xenial
44
cache: pip
55

66
matrix:
77
include:
8-
- python: 2.6
9-
env: TOXENV=py26
10-
- python: 2.7
11-
env: TOXENV=py27
12-
- python: 3.4
13-
env: TOXENV=py34
148
- python: 3.5
159
env: TOXENV=py35
1610
- python: 3.6
1711
env: TOXENV=py36
18-
- python: 2.7
19-
env: TOXENV=sphinx06
20-
- python: 2.7
21-
env: TOXENV=sphinx10
12+
- python: 3.7
13+
env: TOXENV=py37
14+
- python: 3.8
15+
env: TOXENV=py38
2216
- python: 3.6
2317
env: TOXENV=sphinx11
2418
- python: 3.6
@@ -38,5 +32,5 @@ matrix:
3832
- python: 3.6
3933
env: TOXENV=sphinx-dev
4034

41-
install: pip install docutils==0.12 tox
35+
install: pip install docutils tox
4236
script: tox

setup.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import sys
3-
42
from setuptools import setup, find_packages
53

64

@@ -14,11 +12,10 @@
1412
"License :: OSI Approved :: BSD License",
1513
"Operating System :: OS Independent",
1614
"Programming Language :: Python",
17-
"Programming Language :: Python :: 2.6",
18-
"Programming Language :: Python :: 2.7",
19-
"Programming Language :: Python :: 3.4",
2015
"Programming Language :: Python :: 3.5",
2116
"Programming Language :: Python :: 3.6",
17+
"Programming Language :: Python :: 3.7",
18+
"Programming Language :: Python :: 3.8",
2219
"Topic :: Documentation",
2320
"Topic :: Documentation :: Sphinx",
2421
"Topic :: Software Development",
@@ -28,12 +25,6 @@
2825
"Topic :: Utilities",
2926
]
3027

31-
test_require = []
32-
if sys.version_info < (2, 7):
33-
test_require.append('unittest2')
34-
if sys.version_info < (3, 3):
35-
test_require.append('mock')
36-
3728
with open('README.rst') as readme:
3829
long_description = readme.read()
3930
long_description += '\n\n'
@@ -56,8 +47,6 @@
5647
include_package_data=True,
5748
install_requires=[
5849
'Sphinx',
59-
'six',
6050
],
61-
tests_require=test_require,
62-
python_requires='>=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
51+
python_requires='>=3.5',
6352
)

src/sphinx_testing/path.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,14 @@
1212
import shutil
1313
from codecs import open
1414

15-
from six import PY2, text_type
16-
1715

1816
FILESYSTEMENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding()
1917

2018

21-
class path(text_type):
19+
class path(str):
2220
"""
2321
Represents a path which behaves like a string.
2422
"""
25-
if PY2:
26-
def __new__(cls, s, encoding=FILESYSTEMENCODING, errors='strict'):
27-
if isinstance(s, str):
28-
s = s.decode(encoding, errors)
29-
return text_type.__new__(cls, s)
30-
return text_type.__new__(cls, s)
3123

3224
@property
3325
def parent(self):
@@ -217,4 +209,4 @@ def joinpath(self, *args):
217209
__div__ = __truediv__ = joinpath
218210

219211
def __repr__(self):
220-
return '%s(%s)' % (self.__class__.__name__, text_type.__repr__(self))
212+
return '%s(%s)' % (self.__class__.__name__, str.__repr__(self))

src/sphinx_testing/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import os.path
1111
import shutil
12-
from six import StringIO
12+
from io import StringIO
1313
from functools import wraps
1414
from textwrap import dedent
1515

tests/test_path.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
# -*- coding: utf-8 -*-
22

33
import os
4-
import sys
54
import shutil
5+
import unittest
66
from tempfile import mkdtemp
77
from sphinx_testing import with_tmpdir
88
from sphinx_testing.path import path
99

10-
if sys.version_info < (2, 7):
11-
import unittest2 as unittest
12-
else:
13-
import unittest
14-
15-
if sys.version_info < (3,):
16-
unittest.TestCase.assertCountEqual = unittest.TestCase.assertItemsEqual
17-
1810

1911
class TestPath(unittest.TestCase):
2012
def test_instantiate(self):

tests/test_tmpdir.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
# -*- coding: utf-8 -*-
22

3-
import sys
43
import shutil
4+
import unittest
55
from sphinx_testing.path import path
66
from sphinx_testing.tmpdir import mkdtemp, with_tmpdir
77

8-
if sys.version_info < (2, 7):
9-
import unittest2 as unittest
10-
else:
11-
import unittest
12-
138

149
class TestTmpdir(unittest.TestCase):
1510
def test_mkdtemp(self):

tests/test_util.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
# -*- coding: utf-8 -*-
22

33
import os
4-
import sys
54
import sphinx
6-
from six import StringIO
5+
import unittest
6+
from io import StringIO
7+
from unittest.mock import patch
78
from sphinx_testing.path import path
89
from sphinx_testing.tmpdir import mkdtemp
910
from sphinx_testing.util import TestApp, with_app
1011

11-
if sys.version_info < (2, 7):
12-
import unittest2 as unittest
13-
else:
14-
import unittest
15-
16-
if sys.version_info < (3,):
17-
unittest.TestCase.assertCountEqual = unittest.TestCase.assertItemsEqual
18-
19-
if sys.version_info < (3, 3):
20-
from mock import patch
21-
else:
22-
from unittest.mock import patch
23-
2412

2513
class TestSphinxTesting(unittest.TestCase):
2614
def test_TestApp(self):

tox.ini

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
11
[tox]
2-
envlist=py26,py27,py34,sphinx06,sphinx10,sphinx11,sphinx12,sphinx13,sphinx14,sphinx15,sphinx16,sphinx17,sphinx18,sphinx-dev
2+
envlist=sphinx11,sphinx12,sphinx13,sphinx14,sphinx15,sphinx16,sphinx17,sphinx18,sphinx-dev
33

44
[testenv]
55
deps=
66
nose
7-
mock
87
flake8
98
passenv=
109
TRAVIS*
1110
commands=
1211
nosetests
1312
flake8 setup.py src/ tests/
1413

15-
[testenv:py26]
16-
deps=
17-
{[testenv]deps}
18-
unittest2
19-
Sphinx <= 1.4.9999
20-
commands=
21-
nosetests
22-
23-
[testenv:sphinx06]
24-
deps=
25-
{[testenv]deps}
26-
Sphinx <= 0.6.9999
27-
28-
[testenv:sphinx10]
29-
deps=
30-
{[testenv]deps}
31-
Sphinx <= 1.0.9999
32-
docutils < 0.16
33-
3414
[testenv:sphinx11]
3515
deps=
3616
{[testenv]deps}

0 commit comments

Comments
 (0)