Merge branch '1.7-release'

This commit is contained in:
Takeshi KOMIYA
2018-02-11 19:35:48 +09:00
8 changed files with 122 additions and 26 deletions

View File

@@ -67,6 +67,8 @@ Bugs fixed
* #4223: doctest: failing tests reported in wrong file, at wrong line
* i18n: message catalogs are not compiled if specific filenames are given for
``sphinx-build`` as arguments (refs: #4560)
* #4027: sphinx.ext.autosectionlabel now expects labels to be the same as they
are in the raw source; no smart quotes, nothig fancy.
Testing
--------

View File

@@ -35,10 +35,11 @@ def register_sections_as_label(app, document):
for node in document.traverse(nodes.section):
labelid = node['ids'][0]
docname = app.env.docname
ref_name = getattr(node[0], 'rawsource', node[0].astext())
if app.config.autosectionlabel_prefix_document:
name = nodes.fully_normalize_name(docname + ':' + node[0].astext())
name = nodes.fully_normalize_name(docname + ':' + ref_name)
else:
name = nodes.fully_normalize_name(node[0].astext())
name = nodes.fully_normalize_name(ref_name)
sectname = clean_astext(node[0])
if name in labels:

View File

@@ -209,7 +209,7 @@ class SphinxBaseFileInput(FileInput):
class SphinxFileInput(SphinxBaseFileInput):
"""A basic FileInput for Sphinx."""
pass
supported = ('*',) # special source input
class SphinxRSTFileInput(SphinxBaseFileInput):
@@ -226,6 +226,7 @@ class SphinxRSTFileInput(SphinxBaseFileInput):
For that reason, ``sphinx.parsers.RSTParser`` should be used with this to parse
a content correctly.
"""
supported = ('restructuredtext',)
def prepend_prolog(self, text, prolog):
# type: (StringList, unicode) -> None
@@ -312,8 +313,8 @@ def read_doc(app, env, filename):
def setup(app):
# type: (Sphinx) -> Dict[unicode, Any]
app.registry.add_source_input('*', SphinxFileInput)
app.registry.add_source_input('restructuredtext', SphinxRSTFileInput)
app.registry.add_source_input(SphinxFileInput)
app.registry.add_source_input(SphinxRSTFileInput)
return {
'version': 'builtin',

View File

@@ -281,11 +281,13 @@ class SphinxComponentRegistry(object):
parser.set_application(app)
return parser
def add_source_input(self, filetype, input_class):
# type: (unicode, Type[Input]) -> None
if filetype in self.source_inputs:
raise ExtensionError(__('source_input for %r is already registered') % filetype)
self.source_inputs[filetype] = input_class
def add_source_input(self, input_class):
# type: (Type[Input]) -> None
for filetype in input_class.supported:
if filetype in self.source_inputs:
raise ExtensionError(__('source_input for %r is already registered') %
filetype)
self.source_inputs[filetype] = input_class
def get_source_input(self, filetype):
# type: (unicode) -> Type[Input]

View File

@@ -15,6 +15,9 @@ For Windows users
For UNIX users
--------------
This one's got an apostrophe
----------------------------
References
==========
@@ -23,3 +26,4 @@ References
* :ref:`index:Installation`
* :ref:`index:For Windows users`
* :ref:`index:For UNIX users`
* :ref:`index:This one's got an apostrophe`

View File

@@ -15,6 +15,9 @@ For Windows users
For UNIX users
--------------
This one's got an apostrophe
----------------------------
References
==========
@@ -23,3 +26,4 @@ References
* :ref:`Installation`
* :ref:`For Windows users`
* :ref:`For UNIX users`
* :ref:`This one's got an apostrophe`

View File

@@ -35,6 +35,13 @@ def test_autosectionlabel_html(app, status, warning):
'<span class="std std-ref">For UNIX users</span></a></li>')
assert re.search(html, content, re.S)
# for smart_quotes (refs: #4027)
html = (u'<li><a class="reference internal" '
u'href="#this-one-s-got-an-apostrophe">'
u'<span class="std std-ref">This ones got an apostrophe'
u'</span></a></li>')
assert re.search(html, content, re.S)
# Re-use test definition from above, just change the test root directory
@pytest.mark.sphinx('html', testroot='ext-autosectionlabel-prefix-document')

View File

@@ -1,19 +1,11 @@
Release checklist
=================
for stable releases
-------------------
* open https://travis-ci.org/sphinx-doc/sphinx/branches and check **X.Y** branch is green
* Run `git status` and check nothing changed
* Update sphinx/locale/sphinx.pot if first major release (beta1)
* Run `python setup.py extract_messages`
* Run `(cd sphinx/locale; tx push -s)`
* Update sphinx/locale/<lang>/ files if final major release ...
* Run `(cd sphinx/locale; tx pull -a -f)`
* Run `python setup.py compile_catalog`
* Run `git commit -am 'Update message catalogs'`
* Run `git fetch; git status` and check nothing changed
* `python utils/bump_version.py X.Y.Z`
* Check diff by `git diff`
* Edit CHANGES if empty section exists
@@ -22,16 +14,99 @@ Release checklist
* `python setup.py release bdist_wheel sdist upload --identity=[your key]`
* open https://pypi.python.org/pypi/Sphinx and check there are no obvious errors
* `git tag vX.Y.Z`
* Merge default into X.Y branch if final major release
* `git push origin X.Y --tags`
* open https://readthedocs.org/dashboard/sphinx/versions/ and enable the released version
* `python utils/bump_version.py --in-develop X.Y.Zb0` (ex. 1.5.3b0)
* Check diff by `git diff`
* `git commit -am 'Bump version'`
* `git push origin X.Y`
* `git push origin X.Y --tags`
* `git checkout master`
* `git merge X.Y`
* `git push origin master`
* Update `sphinx-doc-translations <https://github.com/sphinx-doc/sphinx-doc-translations>`_
* Add new version/milestone to tracker categories
* Write announcement and send to sphinx-dev, sphinx-users and python-announce
for first beta releases
-----------------------
* open https://travis-ci.org/sphinx-doc/sphinx/branches and check **master** branch is green
* Run `git fetch; git status` and check nothing changed
* Run `python setup.py extract_messages`
* Run `(cd sphinx/locale; tx push -s)`
* `python utils/bump_version.py X.Y.0b1`
* Check diff by `git diff`
* Edit CHANGES if empty section exists
* `git commit -am 'Bump to X.Y.0 beta1'`
* `make clean`
* `python setup.py release bdist_wheel sdist upload --identity=[your key]`
* open https://pypi.python.org/pypi/Sphinx and check there are no obvious errors
* `git tag vX.Y.0b1`
* `python utils/bump_version.py --in-develop X.Y.0b2` (ex. 1.6.0b2)
* Check diff by `git diff`
* `git commit -am 'Bump version'`
* `git checkout -b X.Y`
* `git push origin X.Y --tags`
* `git checkout master`
* `git merge X.Y`
* `python utils/bump_version.py --in-develop A.B.0b0` (ex. 1.7.0b0)
* Check diff by `git diff`
* `git commit -am 'Bump version'`
* `git push origin master`
* Update `sphinx-doc-translations <https://github.com/sphinx-doc/sphinx-doc-translations>`_
* Add new version/milestone to tracker categories
* Write announcement and send to sphinx-dev, sphinx-users and python-announce
for other beta releases
-----------------------
* open https://travis-ci.org/sphinx-doc/sphinx/branches and check **X.Y** branch is green
* Run `git fetch; git status` and check nothing changed
* `python utils/bump_version.py X.Y.0bN`
* Check diff by `git diff`
* Edit CHANGES if empty section exists
* `git commit -am 'Bump to X.Y.0 betaN'`
* `make clean`
* `python setup.py release bdist_wheel sdist upload --identity=[your key]`
* open https://pypi.python.org/pypi/Sphinx and check there are no obvious errors
* `git tag vX.Y.0bN`
* `python utils/bump_version.py --in-develop X.Y.0bM` (ex. 1.6.0b3)
* Check diff by `git diff`
* `git commit -am 'Bump version'`
* `git push origin X.Y --tags`
* `git checkout master`
* `git merge X.Y`
* `git push origin master`
* Update `sphinx-doc-translations <https://github.com/sphinx-doc/sphinx-doc-translations>`_
* Add new version/milestone to tracker categories
* Write announcement and send to sphinx-dev, sphinx-users and python-announce
for major releases
------------------
* open https://travis-ci.org/sphinx-doc/sphinx/branches and check **X.Y** branch is green
* Run `git fetch; git status` and check nothing changed
* Run `(cd sphinx/locale; tx pull -a -f)`
* Run `python setup.py compile_catalog`
* Run `git add sphinx`
* Run `git commit -am 'Update message catalogs'`
* `python utils/bump_version.py X.Y.0`
* Check diff by `git diff`
* Edit CHANGES if empty section exists
* `git commit -am 'Bump to X.Y.0 final'`
* `make clean`
* `python setup.py release bdist_wheel sdist upload --identity=[your key]`
* open https://pypi.python.org/pypi/Sphinx and check there are no obvious errors
* `git tag vX.Y.0`
* `python utils/bump_version.py --in-develop X.Y.1b0` (ex. 1.6.1b0)
* Check diff by `git diff`
* `git commit -am 'Bump version'`
* `git push origin X.Y --tags`
* `git checkout master`
* `git merge X.Y`
* `git push origin master`
* `git checkout A.B` (checkout old stable)
* Run `git tag A.B` to paste a tag instead branch
* Run `git push origin :A.B --tags` to remove old stable branch
* open https://readthedocs.org/dashboard/sphinx/versions/ and enable the released version
* Update `sphinx-doc-translations <https://github.com/sphinx-doc/sphinx-doc-translations>`_
* Add new version/milestone to tracker categories
* Write announcement and send to sphinx-dev, sphinx-users and python-announce