webspec-index 0.2.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.
- webspec_index-0.2.0/.github/workflows/ci.yml +60 -0
- webspec_index-0.2.0/.github/workflows/release.yml +180 -0
- webspec_index-0.2.0/.gitignore +6 -0
- webspec_index-0.2.0/Cargo.lock +2888 -0
- webspec_index-0.2.0/Cargo.toml +64 -0
- webspec_index-0.2.0/PKG-INFO +152 -0
- webspec_index-0.2.0/README.md +122 -0
- webspec_index-0.2.0/pyproject.toml +49 -0
- webspec_index-0.2.0/src/db/mod.rs +40 -0
- webspec_index-0.2.0/src/db/queries.rs +357 -0
- webspec_index-0.2.0/src/db/schema.rs +129 -0
- webspec_index-0.2.0/src/db/write.rs +356 -0
- webspec_index-0.2.0/src/fetch/github.rs +2 -0
- webspec_index-0.2.0/src/fetch/mod.rs +149 -0
- webspec_index-0.2.0/src/fetch/snapshot.rs +2 -0
- webspec_index-0.2.0/src/format.rs +464 -0
- webspec_index-0.2.0/src/lib.rs +473 -0
- webspec_index-0.2.0/src/model.rs +176 -0
- webspec_index-0.2.0/src/parse/algorithms.rs +415 -0
- webspec_index-0.2.0/src/parse/idl.rs +118 -0
- webspec_index-0.2.0/src/parse/markdown.rs +555 -0
- webspec_index-0.2.0/src/parse/mod.rs +150 -0
- webspec_index-0.2.0/src/parse/references.rs +463 -0
- webspec_index-0.2.0/src/parse/sections.rs +1171 -0
- webspec_index-0.2.0/src/provider/mod.rs +28 -0
- webspec_index-0.2.0/src/provider/whatwg.rs +136 -0
- webspec_index-0.2.0/src/python.rs +162 -0
- webspec_index-0.2.0/src/spec_registry.rs +64 -0
- webspec_index-0.2.0/tests/fixtures/algorithms/bikeshed_algorithm.html +12 -0
- webspec_index-0.2.0/tests/fixtures/algorithms/mixed_definitions_algorithms.html +11 -0
- webspec_index-0.2.0/tests/fixtures/algorithms/wattsi_navigate.html +28 -0
- webspec_index-0.2.0/tests/fixtures/definitions/bikeshed_definition.html +3 -0
- webspec_index-0.2.0/tests/fixtures/definitions/definition_with_code.html +3 -0
- webspec_index-0.2.0/tests/fixtures/definitions/wattsi_definition.html +3 -0
- webspec_index-0.2.0/tests/fixtures/headings/bikeshed_heading.html +3 -0
- webspec_index-0.2.0/tests/fixtures/headings/wattsi_heading.html +3 -0
- webspec_index-0.2.0/tests/fixtures/idl/dictionary.html +6 -0
- webspec_index-0.2.0/tests/fixtures/idl/interface.html +7 -0
- webspec_index-0.2.0/tests/fixtures/idl/mixed_idl_definitions.html +14 -0
- webspec_index-0.2.0/webspec_index/__init__.py +199 -0
- webspec_index-0.2.0/webspec_index/__main__.py +197 -0
- webspec_index-0.2.0/webspec_index/mcp.py +271 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test-rust:
|
|
13
|
+
name: Rust tests
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
20
|
+
with:
|
|
21
|
+
components: clippy, rustfmt
|
|
22
|
+
|
|
23
|
+
- uses: Swatinem/rust-cache@v2
|
|
24
|
+
|
|
25
|
+
- name: Check formatting
|
|
26
|
+
run: cargo fmt --check
|
|
27
|
+
|
|
28
|
+
- name: Clippy
|
|
29
|
+
run: cargo clippy -- -D warnings
|
|
30
|
+
|
|
31
|
+
- name: Run tests
|
|
32
|
+
run: cargo test
|
|
33
|
+
|
|
34
|
+
build-python:
|
|
35
|
+
name: Build & smoke test (${{ matrix.os }})
|
|
36
|
+
runs-on: ${{ matrix.os }}
|
|
37
|
+
strategy:
|
|
38
|
+
matrix:
|
|
39
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
40
|
+
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- uses: actions/setup-python@v5
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.12"
|
|
47
|
+
|
|
48
|
+
- name: Build wheel
|
|
49
|
+
uses: PyO3/maturin-action@v1
|
|
50
|
+
with:
|
|
51
|
+
command: build
|
|
52
|
+
args: --release --out dist -i python
|
|
53
|
+
|
|
54
|
+
- name: Install and smoke test
|
|
55
|
+
shell: bash
|
|
56
|
+
run: |
|
|
57
|
+
pip install dist/*.whl
|
|
58
|
+
cd /tmp
|
|
59
|
+
python -c "from webspec_index import query, search, exists, anchors, list_headings, refs, update, clear_db; print('All imports OK')"
|
|
60
|
+
webspec-index --version
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: 'Version tag to simulate (e.g., v0.1.0-test)'
|
|
11
|
+
required: true
|
|
12
|
+
default: 'v0.1.0-test'
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
concurrency:
|
|
18
|
+
group: release
|
|
19
|
+
cancel-in-progress: false
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
# Validate tag matches Cargo.toml and run tests
|
|
23
|
+
validate:
|
|
24
|
+
name: Validate & test
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
31
|
+
|
|
32
|
+
- uses: Swatinem/rust-cache@v2
|
|
33
|
+
|
|
34
|
+
- name: Check version matches tag
|
|
35
|
+
if: github.event_name == 'push'
|
|
36
|
+
run: |
|
|
37
|
+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
|
38
|
+
CARGO_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
|
|
39
|
+
echo "Tag version: $TAG_VERSION"
|
|
40
|
+
echo "Cargo version: $CARGO_VERSION"
|
|
41
|
+
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
|
|
42
|
+
echo "::error::Tag v$TAG_VERSION does not match Cargo.toml version $CARGO_VERSION"
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
- name: Run tests
|
|
47
|
+
run: cargo test
|
|
48
|
+
|
|
49
|
+
# Build wheels for multiple platforms
|
|
50
|
+
build-wheels:
|
|
51
|
+
name: Build wheels (${{ matrix.os }})
|
|
52
|
+
needs: validate
|
|
53
|
+
runs-on: ${{ matrix.os }}
|
|
54
|
+
strategy:
|
|
55
|
+
matrix:
|
|
56
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
57
|
+
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
|
|
61
|
+
- uses: actions/setup-python@v5
|
|
62
|
+
with:
|
|
63
|
+
python-version: "3.12"
|
|
64
|
+
|
|
65
|
+
- name: Build wheels
|
|
66
|
+
uses: PyO3/maturin-action@v1
|
|
67
|
+
with:
|
|
68
|
+
command: build
|
|
69
|
+
args: --release --out dist -i python
|
|
70
|
+
|
|
71
|
+
- name: Smoke test wheel
|
|
72
|
+
shell: bash
|
|
73
|
+
run: |
|
|
74
|
+
pip install dist/*.whl
|
|
75
|
+
cd /tmp
|
|
76
|
+
python -c "from webspec_index import query, search, exists; print('Import OK')"
|
|
77
|
+
webspec-index --version
|
|
78
|
+
|
|
79
|
+
- name: Upload wheels
|
|
80
|
+
uses: actions/upload-artifact@v4
|
|
81
|
+
with:
|
|
82
|
+
name: wheels-${{ matrix.os }}
|
|
83
|
+
path: dist
|
|
84
|
+
retention-days: 5
|
|
85
|
+
|
|
86
|
+
# Build source distribution
|
|
87
|
+
build-sdist:
|
|
88
|
+
name: Build source distribution
|
|
89
|
+
needs: validate
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
|
|
92
|
+
steps:
|
|
93
|
+
- uses: actions/checkout@v4
|
|
94
|
+
|
|
95
|
+
- name: Build sdist
|
|
96
|
+
uses: PyO3/maturin-action@v1
|
|
97
|
+
with:
|
|
98
|
+
command: sdist
|
|
99
|
+
args: --out dist
|
|
100
|
+
|
|
101
|
+
- name: Upload sdist
|
|
102
|
+
uses: actions/upload-artifact@v4
|
|
103
|
+
with:
|
|
104
|
+
name: sdist
|
|
105
|
+
path: dist
|
|
106
|
+
retention-days: 5
|
|
107
|
+
|
|
108
|
+
# Publish to PyPI using Trusted Publishers (OIDC)
|
|
109
|
+
publish:
|
|
110
|
+
name: Publish to PyPI
|
|
111
|
+
needs: [build-wheels, build-sdist]
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
114
|
+
environment:
|
|
115
|
+
name: pypi
|
|
116
|
+
url: https://pypi.org/project/webspec-index/
|
|
117
|
+
permissions:
|
|
118
|
+
id-token: write
|
|
119
|
+
contents: read
|
|
120
|
+
|
|
121
|
+
steps:
|
|
122
|
+
- name: Download all artifacts
|
|
123
|
+
uses: actions/download-artifact@v4
|
|
124
|
+
with:
|
|
125
|
+
pattern: "*"
|
|
126
|
+
merge-multiple: true
|
|
127
|
+
path: dist
|
|
128
|
+
|
|
129
|
+
- name: List distributions
|
|
130
|
+
run: ls -lh dist/
|
|
131
|
+
|
|
132
|
+
- name: Publish to PyPI
|
|
133
|
+
uses: PyO3/maturin-action@v1
|
|
134
|
+
with:
|
|
135
|
+
command: upload
|
|
136
|
+
args: --skip-existing dist/*
|
|
137
|
+
|
|
138
|
+
# Create GitHub Release
|
|
139
|
+
github-release:
|
|
140
|
+
name: Create GitHub Release
|
|
141
|
+
needs: publish
|
|
142
|
+
runs-on: ubuntu-latest
|
|
143
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
144
|
+
permissions:
|
|
145
|
+
contents: write
|
|
146
|
+
|
|
147
|
+
steps:
|
|
148
|
+
- uses: actions/checkout@v4
|
|
149
|
+
|
|
150
|
+
- name: Download all artifacts
|
|
151
|
+
uses: actions/download-artifact@v4
|
|
152
|
+
with:
|
|
153
|
+
pattern: "*"
|
|
154
|
+
merge-multiple: true
|
|
155
|
+
path: dist
|
|
156
|
+
|
|
157
|
+
- name: Extract version from tag
|
|
158
|
+
id: version
|
|
159
|
+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
160
|
+
|
|
161
|
+
- name: Create Release
|
|
162
|
+
uses: softprops/action-gh-release@v2
|
|
163
|
+
with:
|
|
164
|
+
name: Release v${{ steps.version.outputs.VERSION }}
|
|
165
|
+
generate_release_notes: true
|
|
166
|
+
body: |
|
|
167
|
+
## Installation
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
pip install webspec-index==${{ steps.version.outputs.VERSION }}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Or use with uvx:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
uvx webspec-index@${{ steps.version.outputs.VERSION }} --help
|
|
177
|
+
```
|
|
178
|
+
files: dist/*
|
|
179
|
+
draft: false
|
|
180
|
+
prerelease: false
|