summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-09-02 01:19:47 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-09-15 22:47:47 +0900
commitc147f6496e6e429610452072cb71f5a616992d8e (patch)
treec0b4f993ee4c8f291a0791fa419b354b9ad9d7e4
parent6563a8793fa564999bb65aa771b23255849f7f27 (diff)
downloadsphinx-git-c147f6496e6e429610452072cb71f5a616992d8e.tar.gz
Fix #2919: Drop py26 support
-rw-r--r--.travis.yml1
-rw-r--r--CHANGES2
-rw-r--r--doc/builders.rst3
-rw-r--r--doc/config.rst5
-rw-r--r--doc/install.rst6
-rw-r--r--doc/intro.rst2
-rw-r--r--setup.py6
-rw-r--r--sphinx/__init__.py4
-rw-r--r--sphinx/builders/devhelp.py21
-rw-r--r--sphinx/pycode/pgen2/pgen.py5
-rw-r--r--sphinx/util/inspect.py2
-rw-r--r--sphinx/util/osutil.py4
-rw-r--r--tox.ini7
13 files changed, 22 insertions, 46 deletions
diff --git a/.travis.yml b/.travis.yml
index fc76ab89c..f974364b3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,6 @@ cache:
directories:
- $HOME/.cache/pip
python:
- - "2.6"
- "2.7"
- "3.4"
- "3.5"
diff --git a/CHANGES b/CHANGES
index a1e18467c..fb00d13d5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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
diff --git a/doc/builders.rst b/doc/builders.rst
index 48c5ae4c2..f3bacb139 100644
--- a/doc/builders.rst
+++ b/doc/builders.rst
@@ -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
diff --git a/doc/config.rst b/doc/config.rst
index fb77769d0..7fc91031f 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -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
diff --git a/doc/install.rst b/doc/install.rst
index 16afc490c..b3519e1ba 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -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.
diff --git a/doc/intro.rst b/doc/intro.rst
index 1c3a01cf7..b79f7f4a4 100644
--- a/doc/intro.rst
+++ b/doc/intro.rst
@@ -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.
diff --git a/setup.py b/setup.py
index e583ea84b..3fa024634 100644
--- a/setup.py
+++ b/setup.py
@@ -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',
],
diff --git a/sphinx/__init__.py b/sphinx/__init__.py
index 86eec8a9a..4af336673 100644
--- a/sphinx/__init__.py
+++ b/sphinx/__init__.py
@@ -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
diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py
index 0f88e9f38..fd6f3400e 100644
--- a/sphinx/builders/devhelp.py
+++ b/sphinx/builders/devhelp.py
@@ -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')
diff --git a/sphinx/pycode/pgen2/pgen.py b/sphinx/pycode/pgen2/pgen.py
index 85a1bcc4d..7598e6abc 100644
--- a/sphinx/pycode/pgen2/pgen.py
+++ b/sphinx/pycode/pgen2/pgen.py
@@ -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
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index 81ffe25c8..91c955e10 100644
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -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):
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
index df3e03431..b8fffb220 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -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
diff --git a/tox.ini b/tox.ini
index 58632f7fb..5c5989250 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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