diff --git a/docs/source/conf.py b/docs/source/conf.py index da1b8193..99ef1ff1 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -46,7 +46,11 @@ requires_python = project_metadata["Requires-Python"] specifiers = SpecifierSet(specifiers=requires_python) (specifier,) = specifiers -assert specifier.operator == ">=" +if specifier.operator != ">=": + msg = ( + f"We only support '>=' for Requires-Python, got {specifier.operator}." + ) + raise ValueError(msg) minimum_python_version = specifier.version language = "en" diff --git a/pyproject.toml b/pyproject.toml index aa3600e5..161471da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,27 +114,32 @@ lint.select = [ "ALL", ] lint.ignore = [ - # We are happy to manage our own "complexity". - "C901", # Ruff warns that this conflicts with the formatter. "COM812", # Allow our chosen docstring line-style - no one-line summary. "D200", "D205", "D212", - "D415", # Ruff warns that this conflicts with the formatter. "ISC001", # Ignore "too-many-*" errors as they seem to get in the way more than # helping. "PLR0913", - # Allow 'assert' as we use it for tests. +] + +lint.per-file-ignores."doccmd_*.py" = [ + # Allow asserts in docs. + "S101", +] + +lint.per-file-ignores."docs/source/*.py" = [ + # Allow asserts in docs. "S101", ] lint.per-file-ignores."tests/*.py" = [ - # Do not require tests to have a one-line summary. - "D205", + # Allow asserts in tests. + "S101", ] # Do not automatically remove commented out code.