poetry: Drop customizations.

Prepare for an updated Sphinx with a modern theme.
This commit is contained in:
Laurens Valk
2026-08-24 09:27:25 +02:00
parent 7e79c20f7d
commit 1df788d716
6 changed files with 464 additions and 623 deletions
+3 -1
View File
@@ -32,7 +32,9 @@ jobs:
poetry run python -m pip install --upgrade setuptools
poetry install
- name: Lint Python code
run: poetry run flake8
run: poetry run ruff check
- name: Check Python formatting
run: poetry run ruff format --check
- name: Build package
run: poetry build
- name: Lint docs
+2 -2
View File
@@ -5,9 +5,9 @@
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python",
"ms-python.black-formatter"
"charliermarsh.ruff"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
]
}
}
+1 -6
View File
@@ -4,14 +4,9 @@
},
"python.defaultInterpreterPath": ".venv/bin/python",
"python.autoComplete.extraPaths": ["jedi/src"],
"python.formatting.provider": "none",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.pycodestyleEnabled": false,
"python.linting.enabled": true,
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.languageServer": "Pylance",
"python.testing.pytestArgs": [
+6 -11
View File
@@ -22,6 +22,7 @@
import os
import re
import sys
import tomllib
from docutils import nodes
from docutils.parsers.rst.directives import flag
@@ -30,7 +31,6 @@ from sphinx.application import Sphinx
from sphinx.addnodes import pending_xref
from sphinx.environment import BuildEnvironment
from sphinx.util.nodes import make_refnode
import toml
TOP_DIR = os.path.abspath(os.path.join("..", ".."))
sys.path.insert(0, os.path.join(TOP_DIR, "src"))
@@ -40,7 +40,8 @@ sys.path.append(os.path.abspath("../common/extensions"))
# this line of code grabbed from docs.readthedocs.org
ON_RTD = os.environ.get("READTHEDOCS", None) == "True"
_pyproject = toml.load(os.path.join(TOP_DIR, "pyproject.toml"))
with open(os.path.join(TOP_DIR, "pyproject.toml"), "rb") as _f:
_pyproject = tomllib.load(_f)
# -- General configuration ------------------------------------------------
@@ -146,10 +147,8 @@ add_module_names = False # Hide module name
# -- Options for HTML output ----------------------------------------------
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Bare default theme for now; a new theme will be chosen later.
html_theme = "alabaster"
html_show_sourcelink = False
html_copy_source = False
@@ -167,11 +166,7 @@ html_context = {
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
"style_external_links": True,
"logo_only": True,
"style_nav_header_background": "#0088ce", # Pybricks blue
}
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Generated
+433 -594
View File
File diff suppressed because it is too large Load Diff
+19 -9
View File
@@ -26,18 +26,28 @@ packages = [
]
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.group.lint.dependencies]
black = "^22.3.0"
doc8 = "^0.8.1"
flake8 = "^4.0"
python = "^3.12"
[tool.poetry.group.doc.dependencies]
Sphinx = { git = "https://github.com/pybricks/sphinx.git", rev = "cd277d09" }
sphinx-rtd-theme = "^1.0.0"
toml = "^0.10.0"
sphinx = "^9.1.0"
[tool.poetry.group.lint.dependencies]
ruff = "^0.16.4"
doc8 = "^2.0.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 88
extend-exclude = ["jedi", "examples/pup/tools/hub_menu.py"]
[tool.ruff.lint]
# E501: formatter handles line length; E701: stubs use one-line defs
ignore = ["E501", "E701"]
[tool.doc8]
ignore-path = "jedi/,.venv/,doc/main/build/,doc/api/build/,pybricks.egg-info/,npm/"
max-line-length = 88