Commit Graph

9504 Commits

Author SHA1 Message Date
Stephen Finucane
b778cfe299 sphinx-build: Convert to argparse
Once again, not much different to the previous conversions. We make best
use of the argparse module, allowing us to remove some funky
workarounds.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
c68381bd65 sphinx-quickstart: Move parser to a separate function
For the same reasons as the 'sphinx-apidoc' and 'sphinx-autogen' moves.
As before, we also take the opportunity to add a help string.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
bca566244a sphinx-quickstart: Convert to argparse
Nothing unusual to see here.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
b506d87292 sphinx-autogen: Move main to end of file
Per Python customs.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
6a88b5a6c2 sphinx-autogen: Move parser to a separate function
For the same reasons as the 'sphinx-apidoc' move. We also take the
opportunity to add a help string and epilog while we're at it.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
fcf0c1247f sphinx-autogen: Convert to argparse
Another mostly trivial conversion. The only odd thing here is that we
add a '--version' parameter to keep things in line with the other
applications.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
a3f1489544 sphinx-apidoc: Remove 'normalize_excludes' function
This is a one-liner that really doesn't need to be split out, so don't
do it.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
fa74085afd sphinx-apidoc: Move parser to a separate function
This lets us better reason about what the parser is doing and use tools
like 'sphinx-contrib.autoprogram' in our own documentation in the
future.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
87630c8ae8 sphinx-apidoc: Convert to argparse
This is pretty self-explanatory, with most changes coming about as a
side-effect of argparse vs. optparse API differences.

Lowercase characters are used in help strings, per argparse conventions.
Some tests are converted because argparse natively supports unicode.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Stephen Finucane
bdaab9ef1b Remove static scripts
Executable scripts without the '.py' extension are already created and
installed by setuptools, by way of the 'console_scripts' section. These
scripts are unnecessary noise. If people want to test this behavior
locally, use a virtualenv.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-09 16:28:39 +01:00
Takeshi KOMIYA
75759053ca Merge pull request #4128 from tk0miya/1448_qthelp_namespace
Add qthelp_namespace
2017-10-09 01:38:31 +09:00
Takeshi KOMIYA
1292089255 Close #1448: qthelp: Add new config value; qthelp_namespace 2017-10-08 23:22:56 +09:00
Takeshi KOMIYA
2839fc5f68 Update docs (refs: #1448) 2017-10-08 13:15:43 +09:00
cocoatomo
35d10033c2 Add (optional) u prefixes for Python 2.7 2017-10-08 01:55:53 +09:00
cocoatomo
73fd3f90bf Wrap the line too long 2017-10-08 01:29:07 +09:00
cocoatomo
ff88c8b730 Display reference texts of original and translated messages 2017-10-08 00:06:00 +09:00
Takeshi KOMIYA
46bf9ab4a0 Fix #3692: Unable to build HTML if writing .buildinfo failed 2017-10-07 23:37:45 +09:00
Takeshi KOMIYA
8486f106b0 Merge pull request #4124 from cocoatomo/appropriate-footnote-warning_2
Re-arrange WARNING messages about reference inconsistencies (revised)
2017-10-07 16:16:08 +09:00
Takeshi KOMIYA
bd7d5abf8a Fix mypy violations 2017-10-07 15:47:35 +09:00
Takeshi KOMIYA
c82133f69a Merge branch 'stable' 2017-10-07 15:42:14 +09:00
cocoatomo
349513402a Merge remote-tracking branch 'upstream/stable' into appropriate-footnote-warning_2 2017-10-07 15:38:40 +09:00
Takeshi KOMIYA
7d4dab6928 Fix mypy violations 2017-10-07 15:29:29 +09:00
Takeshi KOMIYA
95f0f4d6a0 Update CHANGES for PR #4112 2017-10-07 15:21:01 +09:00
cocoatomo
aad52ebd09 Divide validation code between refnamed footnote and citation 2017-10-07 10:48:12 +09:00
cocoatomo
1f0c3ce875 Re-arrange WARNING messages about reference inconsistencies 2017-10-07 10:47:59 +09:00
Takeshi KOMIYA
0116cef451 Merge pull request #4109 from sphinx-doc/fix/highlight
fix: #4108 - Search word highlight breaks SVG
2017-10-06 02:22:31 +09:00
Stephen Finucane
160e27e20f utils: Remove 'check_sources'
There are still a couple of checks here but all of them can be removed
now:

- Check if using valid Python syntax
- Check if line length too long
- Check if using 'x == None/True/False'
- Check if using old HTML 3 tags

The first three are already handled by default by the 'flake8' tool. The
last one isn't replaced by anything, but it really isn't worth worrying
about now because the tags it checks for have been dead for a really
long time and would not be used by anyone writing HTML in the last 10
years. Combined, it means we can remove the entire file.

The 'style-check' target is updated to simply alias 'flake8'. It can be
removed in a future release. This allows us to stop using this target in
the Travis jobs, seeing as we already run flake8.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 17:17:27 +01:00
Stephen Finucane
f5c0d64658 utils: Move "header check" to a flake8 plugin
If we want to check style, we run 'tox -e flake8': it shouldn't be
necessary to run some obscure 'make' command too. Make this possible by
moving the sole useful test from the target of this make command to a
flake8 plugin.

This includes a fix for a header that was previously excluded from
checks, but is now included.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 17:17:27 +01:00
Stephen Finucane
64b4d7c686 utils: Use better variable names in check_fileheader
We're going to be doing some surgery on this function, so first clean it
up before we do anything else.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 17:17:27 +01:00
Stephen Finucane
b90e58809f utils: Remove the 'reindent' tool
Nobody seems to be using this, probably because of the 'flake8' target,
and it hasn't been touched, some Python/flake8 updates aside in years.
Just remove it.

The Make target is not removed to both give us time to warn users that
the target is gone and, more importantly, to prevent merge conflicts
with other patches being submitted at the same time.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 17:13:59 +01:00
Takeshi KOMIYA
ae08b2d794 Merge pull request #4119 from stephenfin/the-great-toxification-3
The great toxification (part 3)
2017-10-06 00:48:02 +09:00
Stephen Finucane
8f1905c4ae mypy: Make output a little friendlier
Two default-disabled options are enabled:

- show_column_numbers - Shows context notes before errors
- show_error_context - Shows column numbers in error messages

This should make the output of mypy a little easier to parse.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 16:01:21 +01:00
Yoshiki Shibukawa
36912a5815 fix: #4108 - Search word highlight breaks SVG 2017-10-05 23:29:55 +09:00
Takeshi KOMIYA
5e1047ba12 Merge pull request #4116 from stephenfin/bug/4115
Fix #4115: Typo in doc
2017-10-05 22:59:14 +09:00
Stephen Finucane
6086d7b608 tox: Don't bother setting 'PYTHONDONTWRITEBYTECODE'
As I've previously discovered [1], this doesn't actually do anything in
modern tox. Simply remove it.

[1] https://review.openstack.org/#/c/369986/

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:59:08 +01:00
Stephen Finucane
e023c296e8 tox: Pass posargs to docs
This allows us to do something like the following:

  tox -e docs -- -b man

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:59:08 +01:00
Stephen Finucane
40c8f661ef tox: Ensure 'mypy' targets runs with Python 3.x
Turns out this requires Python 3.2 at a minimum. Who knew? We don't
support Python 3.1 so simply fix to 'python3'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:59:08 +01:00
Stephen Finucane
71a5ec18be tox: Always show 25 slowest tests
pytest supports this natively [1] and this is what is currently used by
Travis. There's value in seeing similar data locally.

[1] https://docs.pytest.org/en/latest/usage.html#profiling-test-execution-duration

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:57:58 +01:00
Stephen Finucane
9d114577dc Fix typo in doc
It's 'py:mod', not 'py:module'. I don't know why this wasn't caught by
Sphinx itself.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:42:37 +01:00
Stephen Finucane
017f124be5 mypy: Move configuration to 'setup.cfg'
Less top-level files = winning [1].

[1] https://mypy.readthedocs.io/en/stable/config_file.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:29:40 +01:00
Stephen Finucane
6d6d3a40f1 tox: Always run coverage
There is value in examining coverage for something like Sphinx. Start
doing this by default, in anticipation of increasing coverage over time.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:18:20 +01:00
Stephen Finucane
c5dec1b6a9 tox: Add pylint target to tox
This isn't enabled by default because it throws so many damn errors.
Perhaps we should simply remove this?

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:18:20 +01:00
Takeshi KOMIYA
c57cd9cb06 Merge branch 'stable' 2017-10-05 00:48:50 +09:00
Takeshi KOMIYA
a7bc29f1bd Update CHANGES for PR #4112 2017-10-05 00:47:34 +09:00
Takeshi KOMIYA
2ba41842bf Merge pull request #4112 from alex/smart-quotes
Don't override the smart_quotes setting if it was already set
2017-10-05 00:46:14 +09:00
Alex Gaynor
ee52c7cd4f Don't override the smart_quotes setting if it was already set
This is needed to fix: https://github.com/sphinx-contrib/spelling/issues/1
2017-10-04 11:22:08 -04:00
Takeshi KOMIYA
50640b700b Fix #4070, #4111: crashes when the warning message contains format strings (again) 2017-10-05 00:00:48 +09:00
Takeshi KOMIYA
4dc46350a7 Update CHANGES for PR #4107 2017-10-04 01:51:37 +09:00
Takeshi KOMIYA
2792cb40b5 Merge pull request #4107 from mitya57/sourcelink-suffix-fallback
Make searchtools.js compatible with pre-Sphinx1.5 templates
2017-10-04 01:50:28 +09:00
Dmitry Shachnev
9da3bf93ff Make searchtools.js compatible with pre-Sphinx1.5 templates
There are still plenty of projects which use custom templates where
DOCUMENTATION_OPTIONS does not define SOURCELINK_SUFFIX.

Currently search does not work in these projects. Make suffix fall
back to .txt since that is the default value of configuration option.
2017-10-03 20:03:07 +07:00