Skip to content

Commit 40ed176

Browse files
authored
Merge branch 'master' into c-domain-speedup
2 parents b3422ac + d59b158 commit 40ed176

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1435
-591
lines changed

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
max-line-length = 95
33
ignore =
44
E116,
5+
E203,
56
E241,
67
E251,
8+
E501,
79
E741,
810
W503,
911
W504,
@@ -29,5 +31,3 @@ exclude =
2931
doc/_build/*,
3032
sphinx/search/*,
3133
doc/usage/extensions/example*.py,
32-
per-file-ignores =
33-
tests/*: E501

.github/workflows/lint.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,7 @@ jobs:
8585
python -m pip install --upgrade pip
8686
python -m pip install --upgrade sphinx-lint
8787
- name: Lint documentation with sphinx-lint
88-
run: >
89-
sphinx-lint
90-
--enable line-too-long
91-
--max-line-length 85
92-
AUTHORS.rst
93-
CHANGES.rst
94-
CODE_OF_CONDUCT.rst
95-
CONTRIBUTING.rst
96-
README.rst
97-
doc/
88+
run: make doclinter
9889

9990
twine:
10091
runs-on: ubuntu-latest

.ruff.toml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -426,37 +426,23 @@ forced-separate = [
426426
preview = true
427427
quote-style = "single"
428428
exclude = [
429-
"sphinx/__init__.py",
430429
"sphinx/addnodes.py",
431430
"sphinx/application.py",
432431
"sphinx/builders/**/*",
433432
"sphinx/cmd/**/*",
434433
"sphinx/config.py",
435-
"sphinx/deprecation.py",
436434
"sphinx/directives/**/*",
437435
"sphinx/domains/**/*",
438436
"sphinx/environment/**/*",
439-
"sphinx/errors.py",
440-
"sphinx/events.py",
441437
"sphinx/ext/**/*",
442-
"sphinx/extension.py",
443-
"sphinx/highlighting.py",
444-
"sphinx/io.py",
445-
"sphinx/jinja2glue.py",
446-
"sphinx/locale/__init__.py",
447-
"sphinx/parsers.py",
448-
"sphinx/project.py",
449438
"sphinx/pycode/**/*",
450439
"sphinx/pygments_styles.py",
451440
"sphinx/registry.py",
452-
"sphinx/roles.py",
453441
"sphinx/search/**/*",
454442
"sphinx/templates/**/*",
455443
"sphinx/testing/**/*",
456-
"sphinx/theming.py",
457444
"sphinx/transforms/**/*",
458445
"sphinx/util/**/*",
459-
"sphinx/versioning.py",
460446
"sphinx/writers/**/*",
461447
"tests/certs/**/*",
462448
"tests/conftest.py",
@@ -485,6 +471,4 @@ exclude = [
485471
"tests/test_util/**/*",
486472
"tests/test_versioning.py",
487473
"tests/test_writers/**/*",
488-
"tests/utils.py",
489-
"utils/**/*",
490474
]

CHANGES.rst

Lines changed: 127 additions & 120 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ type-check:
5858

5959
.PHONY: doclinter
6060
doclinter:
61-
@sphinx-lint --enable all --max-line-length 85 --disable triple-backticks \
62-
-i CHANGES.rst -i LICENSE.rst -i EXAMPLES.rst \
63-
$(addprefix -i doc/, _build _static _templates _themes) \
64-
*.rst doc/ 2>&1 | sort -V
61+
@sphinx-lint --enable all --disable triple-backticks --max-line-length 85 --sort-by filename,line \
62+
$(addprefix -i doc/, _build _static _templates _themes) \
63+
AUTHORS.rst CHANGES.rst CODE_OF_CONDUCT.rst CONTRIBUTING.rst README.rst doc/
6564

6665
.PHONY: test
6766
test:

doc/development/tutorials/examples/helloworld.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
from docutils import nodes
22
from docutils.parsers.rst import Directive
33

4+
from sphinx.application import Sphinx
5+
from sphinx.util.typing import ExtensionMetadata
6+
47

58
class HelloWorld(Directive):
69
def run(self):
710
paragraph_node = nodes.paragraph(text='Hello World!')
811
return [paragraph_node]
912

1013

11-
def setup(app):
14+
def setup(app: Sphinx) -> ExtensionMetadata:
1215
app.add_directive('helloworld', HelloWorld)
1316

1417
return {

doc/development/tutorials/examples/recipe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
from docutils.parsers.rst import directives
44

55
from sphinx import addnodes
6+
from sphinx.application import Sphinx
67
from sphinx.directives import ObjectDescription
78
from sphinx.domains import Domain, Index
89
from sphinx.roles import XRefRole
910
from sphinx.util.nodes import make_refnode
11+
from sphinx.util.typing import ExtensionMetadata
1012

1113

1214
class RecipeDirective(ObjectDescription):
@@ -153,7 +155,7 @@ def add_recipe(self, signature, ingredients):
153155
self.data['recipes'].append((name, signature, 'Recipe', self.env.docname, anchor, 0))
154156

155157

156-
def setup(app):
158+
def setup(app: Sphinx) -> ExtensionMetadata:
157159
app.add_domain(RecipeDomain)
158160

159161
return {

doc/development/tutorials/examples/todo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from docutils import nodes
22
from docutils.parsers.rst import Directive
33

4+
from sphinx.application import Sphinx
45
from sphinx.locale import _
56
from sphinx.util.docutils import SphinxDirective
7+
from sphinx.util.typing import ExtensionMetadata
68

79

810
class todo(nodes.Admonition, nodes.Element):
@@ -111,7 +113,7 @@ def process_todo_nodes(app, doctree, fromdocname):
111113
node.replace_self(content)
112114

113115

114-
def setup(app):
116+
def setup(app: Sphinx) -> ExtensionMetadata:
115117
app.add_config_value('todo_include_todos', False, 'html')
116118

117119
app.add_node(todolist)

doc/extdev/utils.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ Utility components
3535

3636
.. autoclass:: sphinx.events.EventManager
3737
:members:
38+
39+
Utility types
40+
-------------
41+
42+
.. autoclass:: sphinx.util.typing.ExtensionMetadata
43+
:members:

doc/internals/contributing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ To run JavaScript tests, use ``npm``::
197197
npm install
198198
npm run test
199199

200+
.. tip::
201+
202+
``karma`` requires a Firefox binary to use as a test browser.
203+
204+
For Unix-based systems, you can specify the path to the Firefox binary using::
205+
206+
FIREFOX_BIN="/Applications/Firefox.app/Contents/MacOS/firefox" npm test
207+
200208
New unit tests should be included in the ``tests`` directory where
201209
necessary:
202210

0 commit comments

Comments
 (0)