refactor: split the repo into self-contained validator, directory, quickstart, spec and site folders

validator/ holds mewslint (lint, css, fetch, DTD/CSS data); directory/ holds
the mews.page service (app, db, check, pages, cli) and depends on validator/;
quickstart/ holds mews-quickstart and md2mews.py for third parties who want
to create Mews content without cloning the repo; spec/ consolidates doc/ and
dtd/ with the canonical mews-0.1.css; site/ becomes a Pelican project with
the forward-facing pages as Markdown, the check form kept as a raw HTML
snippet. Root pyproject.toml is now a virtual uv workspace over validator,
directory and quickstart, with cross-cutting tests that span more than one
of them staying at the repo root. Makefile and flake.nix updated to match.
This commit is contained in:
randogoth 2026-10-13 12:29:23 +03:00
parent 5fa8708bd1
commit 060d4e00fd
90 changed files with 1290 additions and 287 deletions

View file

@ -1,29 +1,20 @@
[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",
]
[tool.uv.workspace]
members = ["validator", "directory", "quickstart"]
[project.scripts]
mewsd = "mews.cli:main"
mewslint = "mews.lint:main"
mews-quickstart = "mews.quickstart:main"
[tool.uv.sources]
mews = { workspace = true }
mews-directory = { workspace = true }
mews-quickstart = { workspace = true }
[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.
"mews",
"mews-directory",
"mews-quickstart",
# quickstart/md2mews.py declares this in its own script header; tests
# import the script to check its page emitter still matches directory.pages.
"mistune>=3.0",
]
@ -31,7 +22,7 @@ dev = [
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"]
extend-exclude = ["quickstart/md2mews.py", "spec/check_dtd.py"]
[tool.ruff.lint]
select = [
@ -80,7 +71,7 @@ ignore = [
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-first-party = ["mews"]
known-first-party = ["mews", "directory", "quickstart"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
@ -90,12 +81,19 @@ known-first-party = ["mews"]
"PLR2004", # expected values belong in the assertion
"D401", # a fixture docstring names what the fixture is
]
"*/tests/*" = [
"D103",
"PLC0415",
"PLE2502",
"PLR2004",
"D401",
]
# These print their results: they are the command line interface.
"mews/cli.py" = ["T201"]
"mews/lint.py" = ["T201"]
"directory/directory/cli.py" = ["T201"]
"validator/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"]
"quickstart/quickstart/__init__.py" = ["T201", "E501"]
[tool.pytest.ini_options]
testpaths = ["tests"]
@ -103,11 +101,3 @@ testpaths = ["tests"]
# `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"