Skip to content

Commit 99431ee

Browse files
committed
Apply code style to docs/conf.py.
1 parent bf97b98 commit 99431ee

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

‎Makefile‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ build:
1414
python setup.py build_ext --inplace
1515

1616
spell:
17-
codespell src -w
18-
codespell tests -Lcaf,te -w
17+
codespell --write-changes compliance src docs tests
1918

2019
style:
21-
ruff format compliance src tests
22-
ruff check --fix compliance src tests
20+
ruff format compliance docs src tests
21+
ruff check --fix compliance docs src tests
2322

2423
types:
2524
mypy --strict src

‎docs/conf.py‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
import importlib
99
import inspect
1010
import os
11-
import subprocess
1211
import sys
1312

13+
from websockets.version import commit
14+
15+
1416
# -- Path setup --------------------------------------------------------------
1517

1618
# If extensions (or modules to document with autodoc) are in another directory,
@@ -25,7 +27,7 @@
2527
copyright = f"2013-{datetime.date.today().year}, Aymeric Augustin and contributors"
2628
author = "Aymeric Augustin"
2729

28-
from websockets.version import tag as version, version as release
30+
from websockets.version import tag as version, version as release # noqa: E402, F401
2931

3032

3133
# -- General configuration ---------------------------------------------------
@@ -68,7 +70,7 @@
6870
]
6971
# It is currently inconvenient to install PyEnchant on Apple Silicon.
7072
try:
71-
import sphinxcontrib.spelling
73+
import sphinxcontrib.spelling # noqa: F401
7274
except ImportError:
7375
extensions.remove("sphinxcontrib.spelling")
7476

@@ -77,7 +79,8 @@
7779
autodoc_typehints_description_target = "documented"
7880

7981
# Workaround for https://github.com/sphinx-doc/sphinx/issues/9560
80-
from sphinx.domains.python import PythonDomain
82+
from sphinx.domains.python import PythonDomain # noqa: E402
83+
8184

8285
assert PythonDomain.object_types["data"].roles == ("data", "obj")
8386
PythonDomain.object_types["data"].roles = ("data", "class", "obj")
@@ -98,11 +101,12 @@
98101
# This pattern also affects html_static_path and html_extra_path.
99102
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
100103

104+
101105
# Configure viewcode extension.
102-
from websockets.version import commit
103106

104107
code_url = f"https://github.com/python-websockets/websockets/blob/{commit}"
105108

109+
106110
def linkcode_resolve(domain, info):
107111
# Non-linkable objects from the starter kit in the tutorial.
108112
if domain == "js" or info["module"] == "connect4":
@@ -137,6 +141,7 @@ def linkcode_resolve(domain, info):
137141

138142
return f"{code_url}/{file}#L{start}-L{end}"
139143

144+
140145
# Configure opengraph extension
141146

142147
# Social cards don't support the SVG logo. Also, the text preview looks bad.

‎pyproject.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ archs = ["x86_64", "universal2", "arm64"]
4747
[tool.cibuildwheel.linux]
4848
archs = ["auto", "aarch64", "armv7l", "ppc64le", "riscv64", "s390x"]
4949

50+
[tool.codespell]
51+
skip = "docs/_build,docs/_static,*.svg"
52+
ignore-words-list = "caf,te" # used in tests
53+
5054
[tool.coverage.run]
5155
branch = true
5256
core = "ctrace"

0 commit comments

Comments
 (0)