Skip to content

Commit 5935220

Browse files
authored
Update Travis config for default Python 2.7=>3.6 (mkdocs#1782)
Travis has changed their default Python version from 2.7 to 3.6 on April 16, 2019 in anticipation of PY27 support being dropped in 2020. We are now running flake8 on Python 3. Unfortunately, LinkChecker does not yet support Python 3. We need to specify Python 2.7 in both the travis and tox configs to get the test to pass. We'll remove the 2.7 requirement as soon as LinkChecker is updated.
1 parent eb5f3f8 commit 5935220

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ matrix:
99
- env: TOXENV=markdown-lint
1010
before_install: npm install -g markdownlint-cli
1111
- env: TOXENV=linkchecker
12+
python: '2.7'
1213
- env: TOXENV=jshint
1314
before_install: npm install -g jshint
1415
- env: TOXENV=csslint

mkdocs/tests/cli_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_serve_config_file(self, mock_serve):
4949
if PY3:
5050
self.assertIsInstance(kwargs['config_file'], io.BufferedReader)
5151
else:
52-
self.assertTrue(isinstance(kwargs['config_file'], file))
52+
self.assertTrue(isinstance(kwargs['config_file'], file)) # noqa: F821
5353
self.assertEqual(kwargs['config_file'].name, 'mkdocs.yml')
5454

5555
@mock.patch('mkdocs.commands.serve.serve', autospec=True)
@@ -227,7 +227,7 @@ def test_build_config_file(self, mock_build, mock_load_config):
227227
if PY3:
228228
self.assertIsInstance(kwargs['config_file'], io.BufferedReader)
229229
else:
230-
self.assertTrue(isinstance(kwargs['config_file'], file))
230+
self.assertTrue(isinstance(kwargs['config_file'], file)) # noqa: F821
231231
self.assertEqual(kwargs['config_file'].name, 'mkdocs.yml')
232232

233233
@mock.patch('mkdocs.config.load_config', autospec=True)
@@ -405,7 +405,7 @@ def test_gh_deploy_config_file(self, mock_gh_deploy, mock_build, mock_load_confi
405405
if PY3:
406406
self.assertIsInstance(kwargs['config_file'], io.BufferedReader)
407407
else:
408-
self.assertTrue(isinstance(kwargs['config_file'], file))
408+
self.assertTrue(isinstance(kwargs['config_file'], file)) # noqa: F821
409409
self.assertEqual(kwargs['config_file'].name, 'mkdocs.yml')
410410

411411
@mock.patch('mkdocs.config.load_config', autospec=True)

mkdocs/utils/ghp_import.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ def write(pipe, data):
4747
raise
4848
else:
4949
def enc(text):
50-
if isinstance(text, unicode):
50+
if isinstance(text, unicode): # noqa: F821
5151
return text.encode('utf-8')
5252
return text
5353

5454
def dec(text):
55-
if isinstance(text, unicode):
55+
if isinstance(text, unicode): # noqa: F821
5656
return text
5757
return text.decode('utf-8')
5858

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ commands=
1616
py{27,34,35,36,37,py,py3}-integration: {envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds
1717

1818
[testenv:flake8]
19-
basepython = python2.7
2019
deps=-rrequirements/test.txt
2120
commands={envbindir}/flake8 mkdocs --max-line-length=119
2221

0 commit comments

Comments
 (0)