tools: raw_cmd.py split into the package commands/raw/, one module per subcommand (#206)
CI / verify (push) Successful in 7m45s
CI / pwsh (push) Successful in 2m30s
Release / release (push) Successful in 36s
Release / wiki-mirror (push) Skipped

Pure restructuring: every raw subcommand's output, help text and exit code is unchanged; the shared helpers sit in raw/_common.py.

Files changed:
- CHANGES.md
- VERSION
- tools/README.md
- tools/chemenu/cli.py
- tools/chemenu/commands/raw/__init__.py
- tools/chemenu/commands/raw/_common.py
- tools/chemenu/commands/raw/accept.py
- tools/chemenu/commands/raw/capture.py
- tools/chemenu/commands/raw/derive.py
- tools/chemenu/commands/raw/fetch.py
- tools/chemenu/commands/raw/pending.py
- tools/chemenu/commands/raw_cmd.py
- tools/chemenu/tests/test_docs_verify.py
- tools/chemenu/tests/test_export_guidelines.py
- tools/chemenu/tests/test_raw_capture.py
- tools/chemenu/tests/test_raw_cmd.py
- tools/chemenu/tests/test_raw_derive.py
- tools/chemenu/tests/test_raw_derive_testfiles.py
- tools/chemenu/tests/test_raw_fetch.py
- tools/chemenu/upload.py

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnAJ7Z3CpVD3PRbN73QtU2
This commit is contained in:
torbenandClaude Code committed 2026-10-10 11:44:49 +02:00
1 parent 88788d6663
commit 059a0a1840
20 files changed
+2884 -2757

No files matched your search

+1 -1
View File
@@ -1189,7 +1189,7 @@ def test_python_source_is_out_of_scope():
plan = dist_cmd.build_plan()
scanned = docs_verify.shipped_prose()
assert "tools/chemenu/commands/raw_cmd.py" in plan
assert "tools/chemenu/commands/raw/accept.py" in plan
assert not [path for path in scanned if path.endswith(".py")]
# ...while the prose beside it is scanned, templates included.
@@ -21,7 +21,8 @@ from typer.testing import CliRunner
from chemenu import config, guideline_export, repo_capture
from chemenu.cli import app
from chemenu.commands import export_cmd
from chemenu.commands.raw_cmd import raw_accept_command, raw_capture_command, raw_status_command
from chemenu.commands.raw.accept import raw_accept_command
from chemenu.commands.raw.capture import raw_capture_command, raw_status_command
from chemenu.frontmatter_io import write_page
from chemenu.markdown_code import strip_code_spans
from chemenu.search import filters
+3 -6
View File
@@ -21,12 +21,9 @@ import pytest
import typer
from chemenu import config, repo_capture
from chemenu.commands.raw_cmd import (
raw_accept_command,
raw_capture_command,
raw_pending_command,
raw_status_command,
)
from chemenu.commands.raw.accept import raw_accept_command
from chemenu.commands.raw.capture import raw_capture_command, raw_status_command
from chemenu.commands.raw.pending import raw_pending_command
from chemenu.errors import BackendError, ValidationError
from chemenu.frontmatter_io import read_page, write_page
from chemenu.kb_scan import load_kb_pages
+3 -2
View File
@@ -7,7 +7,8 @@ import pytest
import typer
from chemenu import config
from chemenu.commands.raw_cmd import raw_accept_command, raw_pending_command
from chemenu.commands.raw.accept import raw_accept_command
from chemenu.commands.raw.pending import raw_pending_command
from chemenu.frontmatter_io import read_page, write_page
from chemenu.provenance import uncovered_raw_files
from chemenu.kb_scan import load_kb_pages
@@ -15,7 +16,7 @@ from chemenu.kb_scan import load_kb_pages
def _shard() -> str:
"""Today's `raw/<YYYY>/<MM>` shard, as a relative-path string - matches
`raw_cmd._shard_dir()` without importing its internals, the same way the
`raw._common._shard_dir()` without importing its internals, the same way the
rest of the suite asserts against real dates (see test_touch.py)."""
today = datetime.date.today()
return f"raw/{today.year:04d}/{today.month:02d}"
+3 -5
View File
@@ -20,11 +20,9 @@ import typer
import yaml
from chemenu import filters, web_capture
from chemenu.commands.raw_cmd import (
raw_accept_command,
raw_derive_command,
raw_pending_command,
)
from chemenu.commands.raw.accept import raw_accept_command
from chemenu.commands.raw.derive import raw_derive_command
from chemenu.commands.raw.pending import raw_pending_command
W = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
A = "http://schemas.openxmlformats.org/drawingml/2006/main"
@@ -15,7 +15,7 @@ from pathlib import Path
import pytest
from chemenu import filters
from chemenu.commands.raw_cmd import raw_accept_command
from chemenu.commands.raw.accept import raw_accept_command
from chemenu.tests.test_raw_derive import ( # noqa: F401 (tree is a fixture)
_derive,
_header_and_text,
+2 -1
View File
@@ -20,7 +20,8 @@ import typer
import yaml
from chemenu import web_capture
from chemenu.commands.raw_cmd import raw_accept_command, raw_fetch_command
from chemenu.commands.raw.accept import raw_accept_command
from chemenu.commands.raw.fetch import raw_fetch_command
ARTICLE = (
b"<!doctype html><html><head><meta charset=\"utf-8\"><title>A Post</title>"