docweave 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docweave-0.9.0/.github/workflows/publish.yml +111 -0
- docweave-0.9.0/.gitignore +12 -0
- docweave-0.9.0/EXECPLAN-foundations-markdown-mvp.md +791 -0
- docweave-0.9.0/FEEDBACK-blackbox-2026-03-10.md +244 -0
- docweave-0.9.0/LICENSE +21 -0
- docweave-0.9.0/PKG-INFO +334 -0
- docweave-0.9.0/README.md +280 -0
- docweave-0.9.0/pyproject.toml +66 -0
- docweave-0.9.0/src/docweave/__init__.py +1 -0
- docweave-0.9.0/src/docweave/__main__.py +4 -0
- docweave-0.9.0/src/docweave/anchors.py +319 -0
- docweave-0.9.0/src/docweave/backends/__init__.py +1 -0
- docweave-0.9.0/src/docweave/backends/base.py +58 -0
- docweave-0.9.0/src/docweave/backends/markdown_native.py +324 -0
- docweave-0.9.0/src/docweave/backends/registry.py +50 -0
- docweave-0.9.0/src/docweave/cli.py +1023 -0
- docweave-0.9.0/src/docweave/config.py +31 -0
- docweave-0.9.0/src/docweave/diff/__init__.py +0 -0
- docweave-0.9.0/src/docweave/diff/raw.py +80 -0
- docweave-0.9.0/src/docweave/diff/semantic.py +137 -0
- docweave-0.9.0/src/docweave/envelope.py +106 -0
- docweave-0.9.0/src/docweave/evidence/__init__.py +0 -0
- docweave-0.9.0/src/docweave/evidence/bundle.py +65 -0
- docweave-0.9.0/src/docweave/journal.py +97 -0
- docweave-0.9.0/src/docweave/models.py +52 -0
- docweave-0.9.0/src/docweave/plan/__init__.py +0 -0
- docweave-0.9.0/src/docweave/plan/applier.py +226 -0
- docweave-0.9.0/src/docweave/plan/planner.py +120 -0
- docweave-0.9.0/src/docweave/plan/schema.py +111 -0
- docweave-0.9.0/src/docweave/validation.py +76 -0
- docweave-0.9.0/tests/__init__.py +0 -0
- docweave-0.9.0/tests/conftest.py +25 -0
- docweave-0.9.0/tests/fixtures/.gitkeep +0 -0
- docweave-0.9.0/tests/fixtures/duplicate_headings.md +15 -0
- docweave-0.9.0/tests/fixtures/patch_delete_block.yaml +10 -0
- docweave-0.9.0/tests/fixtures/patch_insert_after.yaml +14 -0
- docweave-0.9.0/tests/fixtures/patch_insert_blockquote.yaml +13 -0
- docweave-0.9.0/tests/fixtures/patch_insert_code.yaml +16 -0
- docweave-0.9.0/tests/fixtures/patch_insert_heading.yaml +14 -0
- docweave-0.9.0/tests/fixtures/patch_replace_text.yaml +12 -0
- docweave-0.9.0/tests/fixtures/patch_set_heading.yaml +13 -0
- docweave-0.9.0/tests/fixtures/sample.md +42 -0
- docweave-0.9.0/tests/test_anchors.py +241 -0
- docweave-0.9.0/tests/test_cli.py +310 -0
- docweave-0.9.0/tests/test_cli_anchor.py +131 -0
- docweave-0.9.0/tests/test_cli_inspect.py +88 -0
- docweave-0.9.0/tests/test_diff.py +113 -0
- docweave-0.9.0/tests/test_envelope.py +66 -0
- docweave-0.9.0/tests/test_evidence.py +107 -0
- docweave-0.9.0/tests/test_journal.py +139 -0
- docweave-0.9.0/tests/test_markdown_backend.py +224 -0
- docweave-0.9.0/tests/test_plan_apply.py +439 -0
- docweave-0.9.0/tests/test_validation.py +51 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
paths:
|
|
7
|
+
- "src/docweave/__init__.py"
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
detect-version:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
outputs:
|
|
14
|
+
version: ${{ steps.detect.outputs.version }}
|
|
15
|
+
previous_version: ${{ steps.detect.outputs.previous_version }}
|
|
16
|
+
version_changed: ${{ steps.detect.outputs.version_changed }}
|
|
17
|
+
tag: ${{ steps.detect.outputs.tag }}
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Detect version change
|
|
25
|
+
id: detect
|
|
26
|
+
env:
|
|
27
|
+
VERSION_FILE: src/docweave/__init__.py
|
|
28
|
+
BEFORE_SHA: ${{ github.event.before }}
|
|
29
|
+
EVENT_NAME: ${{ github.event_name }}
|
|
30
|
+
shell: bash
|
|
31
|
+
run: |
|
|
32
|
+
python - <<'PY'
|
|
33
|
+
import os
|
|
34
|
+
import re
|
|
35
|
+
import subprocess
|
|
36
|
+
from pathlib import Path
|
|
37
|
+
|
|
38
|
+
version_re = re.compile(r'__version__\s*=\s*["\'](?P<version>\d+\.\d+\.\d+)["\']')
|
|
39
|
+
version_file = Path(os.environ["VERSION_FILE"])
|
|
40
|
+
current_contents = version_file.read_text(encoding="utf-8")
|
|
41
|
+
current_match = version_re.search(current_contents)
|
|
42
|
+
if current_match is None:
|
|
43
|
+
raise SystemExit(f"Could not read version from {version_file}")
|
|
44
|
+
|
|
45
|
+
current_version = current_match.group("version")
|
|
46
|
+
previous_version = ""
|
|
47
|
+
version_changed = True
|
|
48
|
+
event_name = os.environ.get("EVENT_NAME", "")
|
|
49
|
+
before_sha = os.environ.get("BEFORE_SHA", "")
|
|
50
|
+
|
|
51
|
+
if event_name == "push" and before_sha and set(before_sha) != {"0"}:
|
|
52
|
+
try:
|
|
53
|
+
previous_contents = subprocess.check_output(
|
|
54
|
+
["git", "show", f"{before_sha}:{version_file.as_posix()}"],
|
|
55
|
+
text=True,
|
|
56
|
+
)
|
|
57
|
+
except subprocess.CalledProcessError:
|
|
58
|
+
previous_contents = ""
|
|
59
|
+
previous_match = version_re.search(previous_contents)
|
|
60
|
+
previous_version = previous_match.group("version") if previous_match else ""
|
|
61
|
+
version_changed = previous_version != current_version
|
|
62
|
+
|
|
63
|
+
with Path(os.environ["GITHUB_OUTPUT"]).open("a", encoding="utf-8") as handle:
|
|
64
|
+
handle.write(f"version={current_version}\n")
|
|
65
|
+
handle.write(f"previous_version={previous_version}\n")
|
|
66
|
+
handle.write(f"version_changed={'true' if version_changed else 'false'}\n")
|
|
67
|
+
handle.write(f"tag=v{current_version}\n")
|
|
68
|
+
PY
|
|
69
|
+
|
|
70
|
+
pypi:
|
|
71
|
+
needs: detect-version
|
|
72
|
+
if: github.event_name == 'workflow_dispatch' || needs.detect-version.outputs.version_changed == 'true'
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
permissions:
|
|
75
|
+
id-token: write
|
|
76
|
+
contents: write
|
|
77
|
+
environment:
|
|
78
|
+
name: pypi
|
|
79
|
+
steps:
|
|
80
|
+
- name: Check out repository
|
|
81
|
+
uses: actions/checkout@v4
|
|
82
|
+
|
|
83
|
+
- name: Set up uv
|
|
84
|
+
uses: astral-sh/setup-uv@v5
|
|
85
|
+
with:
|
|
86
|
+
python-version: '3.12'
|
|
87
|
+
enable-cache: true
|
|
88
|
+
|
|
89
|
+
- name: Show publish context
|
|
90
|
+
run: |
|
|
91
|
+
echo "version=${{ needs.detect-version.outputs.version }}"
|
|
92
|
+
echo "previous_version=${{ needs.detect-version.outputs.previous_version }}"
|
|
93
|
+
echo "version_changed=${{ needs.detect-version.outputs.version_changed }}"
|
|
94
|
+
|
|
95
|
+
- name: Build distributions
|
|
96
|
+
run: uv build
|
|
97
|
+
|
|
98
|
+
- name: Publish to PyPI
|
|
99
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
100
|
+
|
|
101
|
+
- name: Create GitHub Release
|
|
102
|
+
env:
|
|
103
|
+
GH_TOKEN: ${{ github.token }}
|
|
104
|
+
RELEASE_TAG: ${{ needs.detect-version.outputs.tag }}
|
|
105
|
+
shell: bash
|
|
106
|
+
run: |
|
|
107
|
+
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
|
|
108
|
+
echo "GitHub release $RELEASE_TAG already exists; skipping."
|
|
109
|
+
exit 0
|
|
110
|
+
fi
|
|
111
|
+
gh release create "$RELEASE_TAG" dist/* --generate-notes --target "$GITHUB_SHA"
|