Fix #2919: Drop py26 support

This commit is contained in:
Takeshi KOMIYA 2016-09-02 01:19:47 +09:00
parent 6563a8793f
commit c147f6496e
13 changed files with 22 additions and 46 deletions

View File

@ -4,7 +4,6 @@ cache:
directories:
- $HOME/.cache/pip
python:
- "2.6"
- "2.7"
- "3.4"
- "3.5"

View File

@ -46,7 +46,7 @@ Incompatible changes
* Fix ``epub`` and ``epub3`` builders that contained links to ``genindex`` even if ``epub_use_index = False``.
* `html_translator_class` is now deprecated.
Use `Sphinx.set_translator()` API instead.
* Drop python 3.3 support
* Drop python 2.6 and 3.3 support
* Drop epub3 builder's ``epub3_page_progression_direction`` option (use ``epub3_writing_mode``).
Features added

View File

@ -277,8 +277,7 @@ for details.
A module that implements `dump()`, `load()`, `dumps()` and `loads()`
functions that conform to the functions with the same names from the
pickle module. Known modules implementing this interface are
`simplejson` (or `json` in Python 2.6), `phpserialize`, `plistlib`,
and others.
`simplejson`, `phpserialize`, `plistlib`, and others.
.. attribute:: out_suffix

View File

@ -1997,9 +1997,8 @@ Options for the linkcheck builder
.. confval:: linkcheck_timeout
A timeout value, in seconds, for the linkcheck builder. **Only works in
Python 2.6 and higher.** The default is to use Python's global socket
timeout.
A timeout value, in seconds, for the linkcheck builder. The default is to
use Python's global socket timeout.
.. versionadded:: 1.1

View File

@ -4,7 +4,7 @@ Installing Sphinx
=================
Since Sphinx is written in the Python language, you need to install Python
(the required version is at least 2.6) and Sphinx.
(the required version is at least 2.7) and Sphinx.
Sphinx packages are available on the `Python Package Index
<https://pypi.python.org/pypi/Sphinx>`_.
@ -80,8 +80,8 @@ sidebar and under "Quick Links", click "Windows Installer" to download.
.. note::
Currently, Python offers two major versions, 2.x and 3.x. Sphinx 1.3 can run
under Python 2.6, 2.7, 3.4, 3.5, with the recommended version being
2.7. This chapter assumes you have installed Python 2.7.
under Python 2.7, 3.4, 3.5, with the recommended version being 2.7. This
chapter assumes you have installed Python 2.7.
Follow the Windows installer for Python.

View File

@ -54,7 +54,7 @@ See the :ref:`pertinent section in the FAQ list <usingwith>`.
Prerequisites
-------------
Sphinx needs at least **Python 2.6** or **Python 3.4** to run, as well as the
Sphinx needs at least **Python 2.7** or **Python 3.4** to run, as well as the
docutils_ and Jinja2_ libraries. Sphinx should work with docutils version 0.10
or some (not broken) SVN trunk snapshot. If you like to have source code
highlighting support, you must also install the Pygments_ library.

View File

@ -37,8 +37,8 @@ Among its features are the following:
* Setuptools integration
'''
if sys.version_info < (2, 6) or (3, 0) <= sys.version_info < (3, 4):
print('ERROR: Sphinx requires at least Python 2.6 or 3.4 to run.')
if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 4):
print('ERROR: Sphinx requires at least Python 2.7 or 3.4 to run.')
sys.exit(1)
requires = [
@ -63,7 +63,7 @@ extras_require = {
],
'test': [
'nose',
'mock', # it would be better for 'test:python_version in "2.6,2.7"'
'mock', # it would be better for 'test:python_version in 2.7'
'simplejson', # better: 'test:platform_python_implementation=="PyPy"'
'html5lib',
],

View File

@ -53,9 +53,9 @@ def main(argv=sys.argv):
def build_main(argv=sys.argv):
"""Sphinx build "main" command-line entry."""
if (sys.version_info[:3] < (2, 6, 0) or
if (sys.version_info[:3] < (2, 7, 0) or
(3, 0, 0) <= sys.version_info[:3] < (3, 4, 0)):
sys.stderr.write('Error: Sphinx requires at least Python 2.6 or 3.4 to run.\n')
sys.stderr.write('Error: Sphinx requires at least Python 2.7 or 3.4 to run.\n')
return 1
try:
from sphinx import cmdline

View File

@ -13,6 +13,7 @@
from __future__ import absolute_import
import re
import gzip
from os import path
from docutils import nodes
@ -24,22 +25,7 @@ from sphinx.builders.html import StandaloneHTMLBuilder
try:
import xml.etree.ElementTree as etree
except ImportError:
try:
import lxml.etree as etree
except ImportError:
try:
import elementtree.ElementTree as etree
except ImportError:
import cElementTree as etree
try:
import gzip
def comp_open(filename, mode='rb'):
return gzip.open(filename + '.gz', mode)
except ImportError:
def comp_open(filename, mode='rb'):
return open(filename, mode)
import lxml.etree as etree
class DevhelpBuilder(StandaloneHTMLBuilder):
@ -129,7 +115,8 @@ class DevhelpBuilder(StandaloneHTMLBuilder):
write_index(title, refs, subitems)
# Dump the XML file
with comp_open(path.join(outdir, outname + '.devhelp'), 'w') as f:
xmlfile = path.join(outdir, outname + '.devhelp.gz')
with gzip.open(xmlfile, 'w') as f:
tree.write(f, 'utf-8')

View File

@ -4,10 +4,7 @@
from __future__ import print_function
from six import iteritems
try:
from collections import OrderedDict
except ImportError: # Fallback for Python 2.6
OrderedDict = dict
from collections import OrderedDict
# Pgen imports

View File

@ -60,7 +60,7 @@ if PY3:
raise TypeError('%r is not a Python function' % func)
return inspect.getfullargspec(func)
else: # 2.6, 2.7
else: # 2.7
from functools import partial
def getargspec(func):

View File

@ -80,8 +80,8 @@ def ensuredir(path):
raise
# This function is same as os.walk of Python2.6, 2.7, 3.2, 3.3 except a
# customization that check UnicodeError.
# This function is same as os.walk of Python2.7 except a customization
# that check UnicodeError.
# The customization obstacle to replace the function with the os.walk.
def walk(top, topdown=True, followlinks=False):
"""Backport of os.walk from 2.6, where the *followlinks* argument was

View File

@ -1,5 +1,5 @@
[tox]
envlist=flake8,py26,py27,py34,py35,pypy,du12,du11,du10
envlist=flake8,py27,py34,py35,pypy,du12,du11,du10
[testenv]
deps=
@ -15,11 +15,6 @@ commands=
{envpython} tests/run.py -I py35 -m '^[tT]est' {posargs}
sphinx-build -q -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html
[testenv:py26]
deps=
mock
{[testenv]deps}
[testenv:py27]
deps=
mock