mews.page/pyproject.toml

113 lines
3.4 KiB
TOML

[project]
name = "mews"
version = "0.1.0"
description = "Page validator and site directory for the Mews Profile"
authors = [{name = "Mews Profile developers"}]
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.12"
dependencies = [
"lxml>=5.0",
"httpx>=0.27",
"publicsuffixlist>=0.10",
"waitress>=3.0",
]
[project.scripts]
mewsd = "mews.cli:main"
mewslint = "mews.lint:main"
mews-quickstart = "mews.quickstart:main"
[dependency-groups]
dev = [
"pytest>=8.0",
"ruff>=0.15",
# md2mews.py declares this in its own script header; tests import the
# script to check its page emitter still matches mews.pages.
"mistune>=3.0",
]
[tool.ruff]
line-length = 88
# Both predate this configuration and run standalone from their own dependency
# headers, so they are left as they are rather than reformatted.
extend-exclude = ["md2mews.py", "dtd/check_dtd.py"]
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PL", # pylint
"RET", # flake8-return
"RUF", # ruff-specific rules
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
"D100", # missing docstring in public module
"D104", # missing docstring in public package
"D203", # blank line before class docstring
"D213", # multi-line docstring summary should start at the second line
"ISC001", # disabled so `ruff format` works without warning
"D105", # missing docstring in magic method
"D107", # missing docstring in __init__
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0913", # too many arguments
"PLR0915", # too many statements
"TRY003", # exception messages are the text shown to the author
"PLR0917", # too many positional arguments: page() mirrors md2mews.page()
# The messages authors read are wrapped across lines inside two-element
# tuples, where a missing comma would raise rather than merge two items.
"ISC004",
]
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-first-party = ["mews"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"D103", # a test name says what it tests
"PLC0415", # imports inside a test keep it self-contained
"PLE2502", # fixtures deliberately carry bidi overrides
"PLR2004", # expected values belong in the assertion
"D401", # a fixture docstring names what the fixture is
]
# These print their results: they are the command line interface.
"mews/cli.py" = ["T201"]
"mews/lint.py" = ["T201"]
# Also a command line tool, and it holds templates for files it writes, whose
# line lengths are the generated file's business rather than this module's.
"mews/quickstart.py" = ["T201", "E501"]
[tool.pytest.ini_options]
testpaths = ["tests"]
# The scaffold build downloads Pelican and takes a minute. Run it with
# `pytest -m slow`, or everything with `--runslow`.
addopts = "-m 'not slow'"
markers = ["slow: needs the network and about a minute"]
[build-system]
requires = ["uv_build>=0.8"]
build-backend = "uv_build"
[tool.uv.build-backend]
module-root = ""
module-name = "mews"