foam-wiki 0.4.0.dev0__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.
- foam_wiki-0.4.0.dev0/.github/workflows/ci.yml +262 -0
- foam_wiki-0.4.0.dev0/.github/workflows/release.yml +357 -0
- foam_wiki-0.4.0.dev0/.gitignore +14 -0
- foam_wiki-0.4.0.dev0/.python-version +1 -0
- foam_wiki-0.4.0.dev0/AGENTS.md +24 -0
- foam_wiki-0.4.0.dev0/CLAUDE.md +24 -0
- foam_wiki-0.4.0.dev0/Cargo.lock +314 -0
- foam_wiki-0.4.0.dev0/Cargo.toml +34 -0
- foam_wiki-0.4.0.dev0/LICENSE +21 -0
- foam_wiki-0.4.0.dev0/MIGRATION.md +111 -0
- foam_wiki-0.4.0.dev0/PERFORMANCE.md +319 -0
- foam_wiki-0.4.0.dev0/PKG-INFO +201 -0
- foam_wiki-0.4.0.dev0/README.md +166 -0
- foam_wiki-0.4.0.dev0/RELEASING.md +86 -0
- foam_wiki-0.4.0.dev0/benchmarks/benchmark_load.py +207 -0
- foam_wiki-0.4.0.dev0/benchmarks/benchmark_search.py +110 -0
- foam_wiki-0.4.0.dev0/pyproject.toml +85 -0
- foam_wiki-0.4.0.dev0/rust/lib.rs +23 -0
- foam_wiki-0.4.0.dev0/rust/parallel.rs +107 -0
- foam_wiki-0.4.0.dev0/rust/parser.rs +1088 -0
- foam_wiki-0.4.0.dev0/rust/rename.rs +129 -0
- foam_wiki-0.4.0.dev0/rust/search.rs +365 -0
- foam_wiki-0.4.0.dev0/rust/slug.rs +87 -0
- foam_wiki-0.4.0.dev0/rust/workspace.rs +2182 -0
- foam_wiki-0.4.0.dev0/scripts/build-release +73 -0
- foam_wiki-0.4.0.dev0/scripts/check_release.py +77 -0
- foam_wiki-0.4.0.dev0/scripts/publish-prerelease +39 -0
- foam_wiki-0.4.0.dev0/scripts/smoke-dist +46 -0
- foam_wiki-0.4.0.dev0/scripts/smoke_installed.py +48 -0
- foam_wiki-0.4.0.dev0/scripts/verify_artifacts.py +221 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/__init__.py +137 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/__main__.py +6 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_changeset.py +107 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_check.py +117 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_cli.py +342 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_collections.py +317 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_config.py +392 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_core.pyi +94 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_dayjs.py +166 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_document.py +502 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_fix.py +44 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_graph.py +56 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_model.py +374 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_mutate.py +1253 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_parser.py +146 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_resolve.py +45 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_templates.py +529 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_util.py +49 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_wikilink.py +64 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/_workspace.py +689 -0
- foam_wiki-0.4.0.dev0/src/foamwiki/py.typed +0 -0
- foam_wiki-0.4.0.dev0/tests/conftest.py +46 -0
- foam_wiki-0.4.0.dev0/tests/fixtures/templates/daily-note.md +8 -0
- foam_wiki-0.4.0.dev0/tests/fixtures/templates/meeting-scratchpad.md +17 -0
- foam_wiki-0.4.0.dev0/tests/test_analysis.py +48 -0
- foam_wiki-0.4.0.dev0/tests/test_cli.py +54 -0
- foam_wiki-0.4.0.dev0/tests/test_config.py +96 -0
- foam_wiki-0.4.0.dev0/tests/test_document.py +197 -0
- foam_wiki-0.4.0.dev0/tests/test_improved_behavior.py +770 -0
- foam_wiki-0.4.0.dev0/tests/test_mutate.py +111 -0
- foam_wiki-0.4.0.dev0/tests/test_mutation_transactions.py +1037 -0
- foam_wiki-0.4.0.dev0/tests/test_native_core.py +178 -0
- foam_wiki-0.4.0.dev0/tests/test_parser.py +88 -0
- foam_wiki-0.4.0.dev0/tests/test_repr.py +147 -0
- foam_wiki-0.4.0.dev0/tests/test_resolve_algorithm.py +34 -0
- foam_wiki-0.4.0.dev0/tests/test_templates.py +768 -0
- foam_wiki-0.4.0.dev0/tests/test_wikilink.py +46 -0
- foam_wiki-0.4.0.dev0/tests/test_workspace.py +108 -0
- foam_wiki-0.4.0.dev0/uv.lock +767 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.event.pull_request.number || github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
python-quality:
|
|
19
|
+
name: Python lint and type check
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
23
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
24
|
+
with:
|
|
25
|
+
python-version-file: .python-version
|
|
26
|
+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
|
|
27
|
+
with:
|
|
28
|
+
toolchain: stable
|
|
29
|
+
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
|
30
|
+
with:
|
|
31
|
+
enable-cache: true
|
|
32
|
+
- name: Install
|
|
33
|
+
run: uv sync --locked
|
|
34
|
+
- name: Ruff
|
|
35
|
+
run: uv run ruff check .
|
|
36
|
+
- name: Basedpyright
|
|
37
|
+
run: uv run basedpyright src scripts
|
|
38
|
+
|
|
39
|
+
python-tests:
|
|
40
|
+
name: Python ${{ matrix.python-version }} tests
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
strategy:
|
|
43
|
+
fail-fast: false
|
|
44
|
+
matrix:
|
|
45
|
+
python-version:
|
|
46
|
+
- "3.10"
|
|
47
|
+
- "3.12"
|
|
48
|
+
- "3.14"
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
51
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python-version }}
|
|
54
|
+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
|
|
55
|
+
with:
|
|
56
|
+
toolchain: stable
|
|
57
|
+
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
|
58
|
+
with:
|
|
59
|
+
enable-cache: true
|
|
60
|
+
- name: Install
|
|
61
|
+
run: uv sync --locked --python python
|
|
62
|
+
- name: Pytest
|
|
63
|
+
run: uv run --no-sync pytest -q
|
|
64
|
+
|
|
65
|
+
rust:
|
|
66
|
+
name: Rust format, lint, and tests
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
70
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
71
|
+
with:
|
|
72
|
+
python-version-file: .python-version
|
|
73
|
+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
|
|
74
|
+
with:
|
|
75
|
+
toolchain: stable
|
|
76
|
+
components: rustfmt, clippy
|
|
77
|
+
- name: Rustfmt
|
|
78
|
+
run: cargo fmt --all --check
|
|
79
|
+
- name: Clippy
|
|
80
|
+
run: cargo clippy --all-targets --all-features --locked -- -D warnings
|
|
81
|
+
- name: Cargo tests
|
|
82
|
+
run: cargo test --all-targets --all-features --locked
|
|
83
|
+
|
|
84
|
+
rust-msrv:
|
|
85
|
+
name: Rust MSRV (1.88)
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
89
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
90
|
+
with:
|
|
91
|
+
python-version-file: .python-version
|
|
92
|
+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
|
|
93
|
+
with:
|
|
94
|
+
toolchain: "1.88.0"
|
|
95
|
+
- name: Check minimum supported Rust version
|
|
96
|
+
run: cargo check --all-targets --all-features --locked
|
|
97
|
+
|
|
98
|
+
wheels-linux:
|
|
99
|
+
name: Linux wheel (${{ matrix.target }})
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
strategy:
|
|
102
|
+
fail-fast: false
|
|
103
|
+
matrix:
|
|
104
|
+
target:
|
|
105
|
+
- x86_64-unknown-linux-gnu
|
|
106
|
+
- aarch64-unknown-linux-gnu
|
|
107
|
+
steps:
|
|
108
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
109
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
110
|
+
with:
|
|
111
|
+
python-version: "3.10"
|
|
112
|
+
- name: Build manylinux2014 wheel
|
|
113
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
114
|
+
with:
|
|
115
|
+
command: build
|
|
116
|
+
maturin-version: v1.14.1
|
|
117
|
+
target: ${{ matrix.target }}
|
|
118
|
+
manylinux: "2014"
|
|
119
|
+
rust-toolchain: stable
|
|
120
|
+
args: --release --locked --out dist
|
|
121
|
+
- name: Smoke-test installed wheel
|
|
122
|
+
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
|
123
|
+
shell: bash
|
|
124
|
+
run: |
|
|
125
|
+
python -m venv "$RUNNER_TEMP/foamwiki-wheel-smoke"
|
|
126
|
+
smoke_python="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/python"
|
|
127
|
+
smoke_cli="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/foamwiki"
|
|
128
|
+
"$smoke_python" -m pip install dist/*.whl
|
|
129
|
+
"$smoke_python" -m pip install "pytest>=8,<10" "pandas>=2" "networkx>=3"
|
|
130
|
+
"$smoke_python" -m pytest -q
|
|
131
|
+
(
|
|
132
|
+
cd "$RUNNER_TEMP"
|
|
133
|
+
"$smoke_python" -I -c "import foamwiki, foamwiki._core; print(foamwiki.__version__)"
|
|
134
|
+
"$smoke_cli" --help >/dev/null
|
|
135
|
+
)
|
|
136
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
137
|
+
with:
|
|
138
|
+
name: wheels-linux-${{ matrix.target }}
|
|
139
|
+
path: dist/*.whl
|
|
140
|
+
|
|
141
|
+
wheels-macos:
|
|
142
|
+
name: macOS wheel (${{ matrix.target }})
|
|
143
|
+
runs-on: ${{ matrix.runner }}
|
|
144
|
+
strategy:
|
|
145
|
+
fail-fast: false
|
|
146
|
+
matrix:
|
|
147
|
+
include:
|
|
148
|
+
- runner: macos-15-intel
|
|
149
|
+
target: x86_64-apple-darwin
|
|
150
|
+
- runner: macos-15
|
|
151
|
+
target: aarch64-apple-darwin
|
|
152
|
+
steps:
|
|
153
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
154
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
155
|
+
with:
|
|
156
|
+
python-version: "3.10"
|
|
157
|
+
- name: Build macOS wheel
|
|
158
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
159
|
+
with:
|
|
160
|
+
command: build
|
|
161
|
+
maturin-version: v1.14.1
|
|
162
|
+
target: ${{ matrix.target }}
|
|
163
|
+
rust-toolchain: stable
|
|
164
|
+
args: --release --locked --out dist
|
|
165
|
+
- name: Smoke-test installed wheel
|
|
166
|
+
shell: bash
|
|
167
|
+
run: |
|
|
168
|
+
python -m venv "$RUNNER_TEMP/foamwiki-wheel-smoke"
|
|
169
|
+
smoke_python="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/python"
|
|
170
|
+
smoke_cli="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/foamwiki"
|
|
171
|
+
"$smoke_python" -m pip install dist/*.whl
|
|
172
|
+
"$smoke_python" -m pip install "pytest>=8,<10" "pandas>=2" "networkx>=3"
|
|
173
|
+
"$smoke_python" -m pytest -q
|
|
174
|
+
(
|
|
175
|
+
cd "$RUNNER_TEMP"
|
|
176
|
+
"$smoke_python" -I -c "import foamwiki, foamwiki._core; print(foamwiki.__version__)"
|
|
177
|
+
"$smoke_cli" --help >/dev/null
|
|
178
|
+
)
|
|
179
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
180
|
+
with:
|
|
181
|
+
name: wheels-macos-${{ matrix.target }}
|
|
182
|
+
path: dist/*.whl
|
|
183
|
+
|
|
184
|
+
wheels-windows:
|
|
185
|
+
name: Windows wheel (x86_64)
|
|
186
|
+
runs-on: windows-latest
|
|
187
|
+
steps:
|
|
188
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
189
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
190
|
+
with:
|
|
191
|
+
python-version: "3.10"
|
|
192
|
+
- name: Build Windows wheel
|
|
193
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
194
|
+
with:
|
|
195
|
+
command: build
|
|
196
|
+
maturin-version: v1.14.1
|
|
197
|
+
target: x86_64-pc-windows-msvc
|
|
198
|
+
rust-toolchain: stable
|
|
199
|
+
args: --release --locked --out dist
|
|
200
|
+
- name: Smoke-test installed wheel
|
|
201
|
+
shell: pwsh
|
|
202
|
+
run: |
|
|
203
|
+
$venv = Join-Path $env:RUNNER_TEMP "foamwiki-wheel-smoke"
|
|
204
|
+
python -m venv $venv
|
|
205
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
206
|
+
$smokePython = Join-Path $venv "Scripts/python.exe"
|
|
207
|
+
$smokeCli = Join-Path $venv "Scripts/foamwiki.exe"
|
|
208
|
+
$wheel = (Resolve-Path "dist/*.whl").Path
|
|
209
|
+
& $smokePython -m pip install $wheel
|
|
210
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
211
|
+
& $smokePython -m pip install "pytest>=8,<10" "pandas>=2" "networkx>=3"
|
|
212
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
213
|
+
& $smokePython -m pytest -q
|
|
214
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
215
|
+
Push-Location $env:RUNNER_TEMP
|
|
216
|
+
try {
|
|
217
|
+
& $smokePython -I -c "import foamwiki, foamwiki._core; print(foamwiki.__version__)"
|
|
218
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
219
|
+
& $smokeCli --help > $null
|
|
220
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
221
|
+
} finally {
|
|
222
|
+
Pop-Location
|
|
223
|
+
}
|
|
224
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
225
|
+
with:
|
|
226
|
+
name: wheels-windows-x86_64
|
|
227
|
+
path: dist/*.whl
|
|
228
|
+
|
|
229
|
+
sdist:
|
|
230
|
+
name: Source distribution smoke test
|
|
231
|
+
runs-on: ubuntu-latest
|
|
232
|
+
steps:
|
|
233
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
234
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
235
|
+
with:
|
|
236
|
+
python-version: "3.10"
|
|
237
|
+
- name: Build source distribution
|
|
238
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
239
|
+
with:
|
|
240
|
+
command: sdist
|
|
241
|
+
maturin-version: v1.14.1
|
|
242
|
+
rust-toolchain: stable
|
|
243
|
+
args: --out dist
|
|
244
|
+
- name: Install and import source distribution
|
|
245
|
+
shell: bash
|
|
246
|
+
run: |
|
|
247
|
+
if tar -tzf dist/*.tar.gz | grep -q '/dist/'; then
|
|
248
|
+
echo "source distribution unexpectedly contains build artifacts" >&2
|
|
249
|
+
exit 1
|
|
250
|
+
fi
|
|
251
|
+
python -m venv "$RUNNER_TEMP/foamwiki-sdist-smoke"
|
|
252
|
+
smoke_python="$RUNNER_TEMP/foamwiki-sdist-smoke/bin/python"
|
|
253
|
+
"$smoke_python" -m pip install dist/*.tar.gz
|
|
254
|
+
(
|
|
255
|
+
cd "$RUNNER_TEMP"
|
|
256
|
+
"$smoke_python" -c "import foamwiki, foamwiki._core; print(foamwiki.__version__)"
|
|
257
|
+
)
|
|
258
|
+
"$RUNNER_TEMP/foamwiki-sdist-smoke/bin/foamwiki" --help >/dev/null
|
|
259
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
260
|
+
with:
|
|
261
|
+
name: sdist
|
|
262
|
+
path: dist/*.tar.gz
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: release-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
validate:
|
|
18
|
+
name: Validate release metadata
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
outputs:
|
|
21
|
+
version: ${{ steps.version.outputs.version }}
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
27
|
+
with:
|
|
28
|
+
python-version-file: .python-version
|
|
29
|
+
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
|
30
|
+
- id: version
|
|
31
|
+
name: Check names, versions, locks, and tag
|
|
32
|
+
shell: bash
|
|
33
|
+
run: |
|
|
34
|
+
args=()
|
|
35
|
+
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
|
|
36
|
+
args+=(--tag "$GITHUB_REF_NAME")
|
|
37
|
+
git fetch --no-tags origin main
|
|
38
|
+
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
|
|
39
|
+
echo "release tag must point to a commit reachable from main" >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
fi
|
|
43
|
+
version="$(
|
|
44
|
+
uv run --no-project --with packaging==26.2 \
|
|
45
|
+
python scripts/check_release.py "${args[@]}" --print-version
|
|
46
|
+
)"
|
|
47
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
48
|
+
|
|
49
|
+
wheels-linux:
|
|
50
|
+
name: Linux wheel (${{ matrix.target }})
|
|
51
|
+
needs: validate
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
strategy:
|
|
54
|
+
fail-fast: false
|
|
55
|
+
matrix:
|
|
56
|
+
target:
|
|
57
|
+
- x86_64-unknown-linux-gnu
|
|
58
|
+
- aarch64-unknown-linux-gnu
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
61
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
62
|
+
with:
|
|
63
|
+
python-version: "3.10"
|
|
64
|
+
- name: Build manylinux2014 wheel
|
|
65
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
66
|
+
with:
|
|
67
|
+
command: build
|
|
68
|
+
maturin-version: v1.14.1
|
|
69
|
+
target: ${{ matrix.target }}
|
|
70
|
+
manylinux: "2014"
|
|
71
|
+
rust-toolchain: stable
|
|
72
|
+
args: --release --locked --out dist
|
|
73
|
+
- name: Smoke-test installed wheel
|
|
74
|
+
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
|
75
|
+
shell: bash
|
|
76
|
+
run: |
|
|
77
|
+
python -m venv "$RUNNER_TEMP/foamwiki-wheel-smoke"
|
|
78
|
+
smoke_python="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/python"
|
|
79
|
+
smoke_cli="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/foamwiki"
|
|
80
|
+
"$smoke_python" -m pip install dist/*.whl
|
|
81
|
+
(
|
|
82
|
+
cd "$RUNNER_TEMP"
|
|
83
|
+
"$smoke_python" -I \
|
|
84
|
+
"$GITHUB_WORKSPACE/scripts/smoke_installed.py" \
|
|
85
|
+
"${{ needs.validate.outputs.version }}"
|
|
86
|
+
"$smoke_cli" --help >/dev/null
|
|
87
|
+
"$smoke_python" -I -m foamwiki --help >/dev/null
|
|
88
|
+
)
|
|
89
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
90
|
+
with:
|
|
91
|
+
name: release-wheel-linux-${{ matrix.target }}
|
|
92
|
+
path: dist/*.whl
|
|
93
|
+
if-no-files-found: error
|
|
94
|
+
|
|
95
|
+
wheels-macos:
|
|
96
|
+
name: macOS wheel (${{ matrix.target }})
|
|
97
|
+
needs: validate
|
|
98
|
+
runs-on: ${{ matrix.runner }}
|
|
99
|
+
strategy:
|
|
100
|
+
fail-fast: false
|
|
101
|
+
matrix:
|
|
102
|
+
include:
|
|
103
|
+
- runner: macos-15-intel
|
|
104
|
+
target: x86_64-apple-darwin
|
|
105
|
+
- runner: macos-15
|
|
106
|
+
target: aarch64-apple-darwin
|
|
107
|
+
steps:
|
|
108
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
109
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
110
|
+
with:
|
|
111
|
+
python-version: "3.10"
|
|
112
|
+
- name: Build macOS wheel
|
|
113
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
114
|
+
with:
|
|
115
|
+
command: build
|
|
116
|
+
maturin-version: v1.14.1
|
|
117
|
+
target: ${{ matrix.target }}
|
|
118
|
+
rust-toolchain: stable
|
|
119
|
+
args: --release --locked --out dist
|
|
120
|
+
- name: Smoke-test installed wheel
|
|
121
|
+
shell: bash
|
|
122
|
+
run: |
|
|
123
|
+
python -m venv "$RUNNER_TEMP/foamwiki-wheel-smoke"
|
|
124
|
+
smoke_python="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/python"
|
|
125
|
+
smoke_cli="$RUNNER_TEMP/foamwiki-wheel-smoke/bin/foamwiki"
|
|
126
|
+
"$smoke_python" -m pip install dist/*.whl
|
|
127
|
+
(
|
|
128
|
+
cd "$RUNNER_TEMP"
|
|
129
|
+
"$smoke_python" -I \
|
|
130
|
+
"$GITHUB_WORKSPACE/scripts/smoke_installed.py" \
|
|
131
|
+
"${{ needs.validate.outputs.version }}"
|
|
132
|
+
"$smoke_cli" --help >/dev/null
|
|
133
|
+
)
|
|
134
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
135
|
+
with:
|
|
136
|
+
name: release-wheel-macos-${{ matrix.target }}
|
|
137
|
+
path: dist/*.whl
|
|
138
|
+
if-no-files-found: error
|
|
139
|
+
|
|
140
|
+
wheels-windows:
|
|
141
|
+
name: Windows wheel (x86_64)
|
|
142
|
+
needs: validate
|
|
143
|
+
runs-on: windows-latest
|
|
144
|
+
steps:
|
|
145
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
146
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
147
|
+
with:
|
|
148
|
+
python-version: "3.10"
|
|
149
|
+
- name: Build Windows wheel
|
|
150
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
151
|
+
with:
|
|
152
|
+
command: build
|
|
153
|
+
maturin-version: v1.14.1
|
|
154
|
+
target: x86_64-pc-windows-msvc
|
|
155
|
+
rust-toolchain: stable
|
|
156
|
+
args: --release --locked --out dist
|
|
157
|
+
- name: Smoke-test installed wheel
|
|
158
|
+
shell: pwsh
|
|
159
|
+
run: |
|
|
160
|
+
$venv = Join-Path $env:RUNNER_TEMP "foamwiki-wheel-smoke"
|
|
161
|
+
python -m venv $venv
|
|
162
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
163
|
+
$smokePython = Join-Path $venv "Scripts/python.exe"
|
|
164
|
+
$smokeCli = Join-Path $venv "Scripts/foamwiki.exe"
|
|
165
|
+
$wheel = (Resolve-Path "dist/*.whl").Path
|
|
166
|
+
& $smokePython -m pip install $wheel
|
|
167
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
168
|
+
Push-Location $env:RUNNER_TEMP
|
|
169
|
+
try {
|
|
170
|
+
& $smokePython -I `
|
|
171
|
+
"$env:GITHUB_WORKSPACE/scripts/smoke_installed.py" `
|
|
172
|
+
"${{ needs.validate.outputs.version }}"
|
|
173
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
174
|
+
& $smokeCli --help > $null
|
|
175
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
176
|
+
} finally {
|
|
177
|
+
Pop-Location
|
|
178
|
+
}
|
|
179
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
180
|
+
with:
|
|
181
|
+
name: release-wheel-windows-x86_64
|
|
182
|
+
path: dist/*.whl
|
|
183
|
+
if-no-files-found: error
|
|
184
|
+
|
|
185
|
+
sdist:
|
|
186
|
+
name: Source distribution
|
|
187
|
+
needs: validate
|
|
188
|
+
runs-on: ubuntu-latest
|
|
189
|
+
steps:
|
|
190
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
191
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
192
|
+
with:
|
|
193
|
+
python-version: "3.14"
|
|
194
|
+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
|
|
195
|
+
with:
|
|
196
|
+
toolchain: stable
|
|
197
|
+
- name: Build source distribution
|
|
198
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
199
|
+
with:
|
|
200
|
+
command: sdist
|
|
201
|
+
maturin-version: v1.14.1
|
|
202
|
+
rust-toolchain: stable
|
|
203
|
+
args: --out dist
|
|
204
|
+
- name: Smoke-test installed source distribution
|
|
205
|
+
shell: bash
|
|
206
|
+
run: |
|
|
207
|
+
python -m venv "$RUNNER_TEMP/foamwiki-sdist-smoke"
|
|
208
|
+
smoke_python="$RUNNER_TEMP/foamwiki-sdist-smoke/bin/python"
|
|
209
|
+
smoke_cli="$RUNNER_TEMP/foamwiki-sdist-smoke/bin/foamwiki"
|
|
210
|
+
"$smoke_python" -m pip install dist/*.tar.gz
|
|
211
|
+
(
|
|
212
|
+
cd "$RUNNER_TEMP"
|
|
213
|
+
"$smoke_python" -I \
|
|
214
|
+
"$GITHUB_WORKSPACE/scripts/smoke_installed.py" \
|
|
215
|
+
"${{ needs.validate.outputs.version }}"
|
|
216
|
+
"$smoke_cli" --help >/dev/null
|
|
217
|
+
)
|
|
218
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
219
|
+
with:
|
|
220
|
+
name: release-sdist
|
|
221
|
+
path: dist/*.tar.gz
|
|
222
|
+
if-no-files-found: error
|
|
223
|
+
|
|
224
|
+
verify:
|
|
225
|
+
name: Verify complete distribution set
|
|
226
|
+
needs:
|
|
227
|
+
- validate
|
|
228
|
+
- wheels-linux
|
|
229
|
+
- wheels-macos
|
|
230
|
+
- wheels-windows
|
|
231
|
+
- sdist
|
|
232
|
+
runs-on: ubuntu-latest
|
|
233
|
+
steps:
|
|
234
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
235
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
236
|
+
with:
|
|
237
|
+
python-version: |
|
|
238
|
+
3.10
|
|
239
|
+
3.14
|
|
240
|
+
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
|
241
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
242
|
+
with:
|
|
243
|
+
pattern: release-*
|
|
244
|
+
path: dist
|
|
245
|
+
merge-multiple: true
|
|
246
|
+
- name: Validate archive names, versions, contents, and platforms
|
|
247
|
+
run: |
|
|
248
|
+
uv run --no-project --with packaging==26.2 \
|
|
249
|
+
python scripts/verify_artifacts.py \
|
|
250
|
+
dist "${{ needs.validate.outputs.version }}" --release-matrix
|
|
251
|
+
- name: Check package metadata
|
|
252
|
+
run: |
|
|
253
|
+
uvx --from twine==6.2.0 twine check --strict dist/*
|
|
254
|
+
uvx --from check-wheel-contents==0.6.3 \
|
|
255
|
+
check-wheel-contents dist/*.whl
|
|
256
|
+
uv publish --dry-run --trusted-publishing never dist/*
|
|
257
|
+
- name: Repeat isolated x86 wheel and sdist smoke tests
|
|
258
|
+
shell: bash
|
|
259
|
+
run: |
|
|
260
|
+
wheel="$(find dist -maxdepth 1 -name '*manylinux*x86_64*.whl' -print -quit)"
|
|
261
|
+
sdist="$(find dist -maxdepth 1 -name '*.tar.gz' -print -quit)"
|
|
262
|
+
python3.10 -m venv "$RUNNER_TEMP/release-wheel"
|
|
263
|
+
"$RUNNER_TEMP/release-wheel/bin/python" -m pip install "$wheel"
|
|
264
|
+
(
|
|
265
|
+
cd "$RUNNER_TEMP"
|
|
266
|
+
"$RUNNER_TEMP/release-wheel/bin/python" -I \
|
|
267
|
+
"$GITHUB_WORKSPACE/scripts/smoke_installed.py" \
|
|
268
|
+
"${{ needs.validate.outputs.version }}"
|
|
269
|
+
)
|
|
270
|
+
python3.14 -m venv "$RUNNER_TEMP/release-sdist"
|
|
271
|
+
"$RUNNER_TEMP/release-sdist/bin/python" -m pip install "$sdist"
|
|
272
|
+
(
|
|
273
|
+
cd "$RUNNER_TEMP"
|
|
274
|
+
"$RUNNER_TEMP/release-sdist/bin/python" -I \
|
|
275
|
+
"$GITHUB_WORKSPACE/scripts/smoke_installed.py" \
|
|
276
|
+
"${{ needs.validate.outputs.version }}"
|
|
277
|
+
)
|
|
278
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
279
|
+
with:
|
|
280
|
+
name: distributions
|
|
281
|
+
path: dist/*
|
|
282
|
+
if-no-files-found: error
|
|
283
|
+
retention-days: 14
|
|
284
|
+
|
|
285
|
+
publish:
|
|
286
|
+
name: Publish to PyPI
|
|
287
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
288
|
+
needs: verify
|
|
289
|
+
runs-on: ubuntu-latest
|
|
290
|
+
environment:
|
|
291
|
+
name: pypi
|
|
292
|
+
url: https://pypi.org/p/foam-wiki
|
|
293
|
+
permissions:
|
|
294
|
+
contents: read
|
|
295
|
+
id-token: write
|
|
296
|
+
steps:
|
|
297
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
298
|
+
with:
|
|
299
|
+
name: distributions
|
|
300
|
+
path: dist
|
|
301
|
+
- name: Publish verified distributions
|
|
302
|
+
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # release/v1
|
|
303
|
+
with:
|
|
304
|
+
packages-dir: dist
|
|
305
|
+
verbose: true
|
|
306
|
+
|
|
307
|
+
smoke-pypi:
|
|
308
|
+
name: Smoke-test PyPI
|
|
309
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
310
|
+
needs: publish
|
|
311
|
+
runs-on: ubuntu-latest
|
|
312
|
+
steps:
|
|
313
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
314
|
+
with:
|
|
315
|
+
python-version: "3.14"
|
|
316
|
+
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
|
317
|
+
- name: Install the exact public-index wheel with propagation retries
|
|
318
|
+
shell: bash
|
|
319
|
+
run: |
|
|
320
|
+
version="${GITHUB_REF_NAME#v}"
|
|
321
|
+
uv venv "$RUNNER_TEMP/pypi-smoke"
|
|
322
|
+
smoke_python="$RUNNER_TEMP/pypi-smoke/bin/python"
|
|
323
|
+
installed=false
|
|
324
|
+
for attempt in {1..12}; do
|
|
325
|
+
if uv --no-cache pip install \
|
|
326
|
+
--python "$smoke_python" \
|
|
327
|
+
--only-binary :all: \
|
|
328
|
+
"foam-wiki==$version"; then
|
|
329
|
+
installed=true
|
|
330
|
+
break
|
|
331
|
+
fi
|
|
332
|
+
echo "PyPI propagation attempt $attempt failed; retrying"
|
|
333
|
+
sleep 10
|
|
334
|
+
done
|
|
335
|
+
[[ "$installed" == true ]]
|
|
336
|
+
(
|
|
337
|
+
cd "$RUNNER_TEMP"
|
|
338
|
+
"$smoke_python" -I - "$version" <<'PY'
|
|
339
|
+
import sys
|
|
340
|
+
import tempfile
|
|
341
|
+
from importlib import metadata
|
|
342
|
+
from pathlib import Path
|
|
343
|
+
|
|
344
|
+
import foamwiki
|
|
345
|
+
import foamwiki._core
|
|
346
|
+
|
|
347
|
+
version = sys.argv[1]
|
|
348
|
+
assert metadata.version("foam-wiki") == version
|
|
349
|
+
assert foamwiki.__version__ == version
|
|
350
|
+
with tempfile.TemporaryDirectory() as raw_root:
|
|
351
|
+
root = Path(raw_root)
|
|
352
|
+
(root / ".foam").mkdir()
|
|
353
|
+
(root / "index.md").write_text("# Index\n\nrelease smoke\n")
|
|
354
|
+
assert len(foamwiki.load(root).search("smoke")) == 1
|
|
355
|
+
PY
|
|
356
|
+
"$RUNNER_TEMP/pypi-smoke/bin/foamwiki" --help >/dev/null
|
|
357
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Agent guidance for foamwiki
|
|
2
|
+
|
|
3
|
+
This repository is a standalone uv-managed Python package: a synchronous,
|
|
4
|
+
notebook-first library + thin CLI for Foam-style markdown wikis.
|
|
5
|
+
|
|
6
|
+
The public API is re-exported from `src/foamwiki/__init__.py`; implementation lives
|
|
7
|
+
in underscore-prefixed modules. The CLI (`src/foamwiki/_cli.py`) is a thin argparse
|
|
8
|
+
shim with no business logic.
|
|
9
|
+
|
|
10
|
+
Use `uv run ...` for repository commands. The standard checks are:
|
|
11
|
+
|
|
12
|
+
- `uv run ruff check .`
|
|
13
|
+
- `uv run basedpyright src`
|
|
14
|
+
- `uv run pytest -q`
|
|
15
|
+
|
|
16
|
+
House style (the `python-coding` mantras): radical simplicity, dataclasses as
|
|
17
|
+
data (not behavior), free functions for verbs, and one teachable placement rule:
|
|
18
|
+
|
|
19
|
+
- intrinsic to a file's text -> attribute (`note.title`, `ws.notes`)
|
|
20
|
+
- needs the whole vault -> method on the noun (`note.backlinks()`, `ws.resolve()`)
|
|
21
|
+
- whole-graph algorithm or mutation -> free function `foamwiki.verb(ws, ...)`
|
|
22
|
+
|
|
23
|
+
Fail loudly with the typed exceptions. pandas and networkx are soft, lazily
|
|
24
|
+
imported dependencies; the core must never import them at module load.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Agent guidance for foamwiki
|
|
2
|
+
|
|
3
|
+
This repository is a standalone uv-managed Python package: a synchronous,
|
|
4
|
+
notebook-first library + thin CLI for Foam-style markdown wikis.
|
|
5
|
+
|
|
6
|
+
The public API is re-exported from `src/foamwiki/__init__.py`; implementation lives
|
|
7
|
+
in underscore-prefixed modules. The CLI (`src/foamwiki/_cli.py`) is a thin argparse
|
|
8
|
+
shim with no business logic.
|
|
9
|
+
|
|
10
|
+
Use `uv run ...` for repository commands. The standard checks are:
|
|
11
|
+
|
|
12
|
+
- `uv run ruff check .`
|
|
13
|
+
- `uv run basedpyright src`
|
|
14
|
+
- `uv run pytest -q`
|
|
15
|
+
|
|
16
|
+
House style (the `python-coding` mantras): radical simplicity, dataclasses as
|
|
17
|
+
data (not behavior), free functions for verbs, and one teachable placement rule:
|
|
18
|
+
|
|
19
|
+
- intrinsic to a file's text -> attribute (`note.title`, `ws.notes`)
|
|
20
|
+
- needs the whole vault -> method on the noun (`note.backlinks()`, `ws.resolve()`)
|
|
21
|
+
- whole-graph algorithm or mutation -> free function `foamwiki.verb(ws, ...)`
|
|
22
|
+
|
|
23
|
+
Fail loudly with the typed exceptions. pandas and networkx are soft, lazily
|
|
24
|
+
imported dependencies; the core must never import them at module load.
|