regexrs-py 0.1.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.
- regexrs_py-0.1.0/.github/workflows/ci.yml +338 -0
- regexrs_py-0.1.0/.github/workflows/lint.yml +129 -0
- regexrs_py-0.1.0/.gitignore +125 -0
- regexrs_py-0.1.0/.readthedocs.yml +33 -0
- regexrs_py-0.1.0/.yamlfmt.yaml +5 -0
- regexrs_py-0.1.0/Cargo.lock +178 -0
- regexrs_py-0.1.0/Cargo.toml +22 -0
- regexrs_py-0.1.0/LICENSE +21 -0
- regexrs_py-0.1.0/PKG-INFO +76 -0
- regexrs_py-0.1.0/README.rst +52 -0
- regexrs_py-0.1.0/build.rs +20 -0
- regexrs_py-0.1.0/changelog/entry.rst.jinja +4 -0
- regexrs_py-0.1.0/docs/Makefile +23 -0
- regexrs_py-0.1.0/docs/make.bat +35 -0
- regexrs_py-0.1.0/docs/source/api.rst +60 -0
- regexrs_py-0.1.0/docs/source/changelog.rst +16 -0
- regexrs_py-0.1.0/docs/source/conf.py +137 -0
- regexrs_py-0.1.0/docs/source/index.rst +11 -0
- regexrs_py-0.1.0/prek.toml +20 -0
- regexrs_py-0.1.0/pyproject.toml +109 -0
- regexrs_py-0.1.0/python/regex_rs/__init__.py +37 -0
- regexrs_py-0.1.0/python/regex_rs/_errors.py +29 -0
- regexrs_py-0.1.0/python/regex_rs/_regex_rs.pyi +1668 -0
- regexrs_py-0.1.0/python/regex_rs/py.typed +0 -0
- regexrs_py-0.1.0/scripts/generate-stubs.sh +16 -0
- regexrs_py-0.1.0/src/errors.rs +20 -0
- regexrs_py-0.1.0/src/haystack.rs +123 -0
- regexrs_py-0.1.0/src/iter.rs +294 -0
- regexrs_py-0.1.0/src/lib.rs +39 -0
- regexrs_py-0.1.0/src/matches.rs +467 -0
- regexrs_py-0.1.0/src/options.rs +161 -0
- regexrs_py-0.1.0/src/pyregex.rs +1202 -0
- regexrs_py-0.1.0/src/set.rs +496 -0
- regexrs_py-0.1.0/tests/test_docstrings.py +47 -0
- regexrs_py-0.1.0/tests/test_regex.py +395 -0
- regexrs_py-0.1.0/uv.lock +1667 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- '**'
|
|
9
|
+
pull_request: {}
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
tests:
|
|
16
|
+
name: Run tests with pytest
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ['3.11', '3.12', '3.13', '3.14', '3.15']
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
23
|
+
with:
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
|
|
26
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
27
|
+
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python-version }}
|
|
30
|
+
enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: uv sync --group dev
|
|
34
|
+
|
|
35
|
+
- name: Run pytest
|
|
36
|
+
run: uv run pytest
|
|
37
|
+
|
|
38
|
+
rust-tests:
|
|
39
|
+
name: Run Rust tests
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
43
|
+
with:
|
|
44
|
+
persist-credentials: false
|
|
45
|
+
|
|
46
|
+
- name: Run cargo test
|
|
47
|
+
run: cargo test --locked
|
|
48
|
+
|
|
49
|
+
msrv:
|
|
50
|
+
name: Check minimum supported Rust version
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
54
|
+
with:
|
|
55
|
+
persist-credentials: false
|
|
56
|
+
|
|
57
|
+
- name: Resolve MSRV
|
|
58
|
+
id: resolve-msrv
|
|
59
|
+
run: echo "MSRV=$(cargo metadata --format-version 1 --no-deps --frozen --quiet --offline | jq -r '.packages[0].rust_version')" >> "$GITHUB_OUTPUT"
|
|
60
|
+
|
|
61
|
+
- name: Install the MSRV toolchain
|
|
62
|
+
run: rustup toolchain install "$MSRV" --profile minimal
|
|
63
|
+
env:
|
|
64
|
+
MSRV: ${{ steps.resolve-msrv.outputs.MSRV }}
|
|
65
|
+
|
|
66
|
+
- name: Run cargo check
|
|
67
|
+
run: cargo "+$MSRV" check --locked
|
|
68
|
+
env:
|
|
69
|
+
MSRV: ${{ steps.resolve-msrv.outputs.MSRV }}
|
|
70
|
+
|
|
71
|
+
docs:
|
|
72
|
+
name: Build and check documentation
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
76
|
+
with:
|
|
77
|
+
persist-credentials: false
|
|
78
|
+
|
|
79
|
+
- name: Set up Python 3.15
|
|
80
|
+
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
81
|
+
with:
|
|
82
|
+
python-version: '3.15'
|
|
83
|
+
enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
|
|
84
|
+
|
|
85
|
+
- name: Install dependencies
|
|
86
|
+
run: uv sync --group docs
|
|
87
|
+
|
|
88
|
+
- name: Lint docs with sphinx-lint
|
|
89
|
+
run: |
|
|
90
|
+
uv run sphinx-lint docs
|
|
91
|
+
|
|
92
|
+
- name: Build docs and check the integrity of external links
|
|
93
|
+
run: |
|
|
94
|
+
uv run sphinx-build --builder linkcheck --fail-on-warning "source" "build"
|
|
95
|
+
uv run sphinx-build --builder html --fail-on-warning "source" "build"
|
|
96
|
+
working-directory: ./docs
|
|
97
|
+
|
|
98
|
+
build-sdist:
|
|
99
|
+
name: Build sdist
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
permissions:
|
|
102
|
+
contents: read
|
|
103
|
+
# Required to attest build provenance, verified by the release job:
|
|
104
|
+
id-token: write
|
|
105
|
+
attestations: write
|
|
106
|
+
steps:
|
|
107
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
108
|
+
with:
|
|
109
|
+
persist-credentials: false
|
|
110
|
+
|
|
111
|
+
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
112
|
+
with:
|
|
113
|
+
# Keep in sync with `build-system.requires` in `pyproject.toml`:
|
|
114
|
+
maturin-version: v1.15.0
|
|
115
|
+
command: sdist
|
|
116
|
+
args: --out dist
|
|
117
|
+
rust-toolchain: stable
|
|
118
|
+
|
|
119
|
+
- uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
|
|
120
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
121
|
+
with:
|
|
122
|
+
subject-path: dist/*
|
|
123
|
+
|
|
124
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
125
|
+
with:
|
|
126
|
+
name: pypi_files_sdist
|
|
127
|
+
path: dist
|
|
128
|
+
|
|
129
|
+
# Reference documentation: https://pyo3.rs/v0.30.1/building-and-distribution.html#py_limited_apiabi3abi3t.
|
|
130
|
+
build:
|
|
131
|
+
name: Build wheels on ${{ matrix.os }} (${{ matrix.target }}${{ matrix.os == 'linux' && format(' - {0}', matrix.manylinux) || '' }})
|
|
132
|
+
permissions:
|
|
133
|
+
contents: read
|
|
134
|
+
# Required to attest build provenance, verified by the release job:
|
|
135
|
+
id-token: write
|
|
136
|
+
attestations: write
|
|
137
|
+
strategy:
|
|
138
|
+
fail-fast: false
|
|
139
|
+
matrix:
|
|
140
|
+
include:
|
|
141
|
+
- os: linux
|
|
142
|
+
runs-on: ubuntu-latest
|
|
143
|
+
target: x86_64
|
|
144
|
+
manylinux: auto
|
|
145
|
+
- os: linux
|
|
146
|
+
runs-on: ubuntu-24.04-arm
|
|
147
|
+
target: aarch64
|
|
148
|
+
manylinux: auto
|
|
149
|
+
- os: linux
|
|
150
|
+
runs-on: ubuntu-latest
|
|
151
|
+
target: x86_64
|
|
152
|
+
manylinux: musllinux_1_2
|
|
153
|
+
- os: linux
|
|
154
|
+
runs-on: ubuntu-24.04-arm
|
|
155
|
+
target: aarch64
|
|
156
|
+
manylinux: musllinux_1_2
|
|
157
|
+
- os: macos
|
|
158
|
+
runs-on: macos-latest
|
|
159
|
+
target: x86_64
|
|
160
|
+
- os: macos
|
|
161
|
+
runs-on: macos-latest
|
|
162
|
+
target: aarch64
|
|
163
|
+
- os: windows
|
|
164
|
+
runs-on: windows-latest
|
|
165
|
+
target: x86_64
|
|
166
|
+
- os: windows
|
|
167
|
+
runs-on: windows-11-arm
|
|
168
|
+
target: aarch64
|
|
169
|
+
|
|
170
|
+
runs-on: ${{ matrix.runs-on }}
|
|
171
|
+
steps:
|
|
172
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
173
|
+
with:
|
|
174
|
+
persist-credentials: false
|
|
175
|
+
|
|
176
|
+
# On Linux, wheels are built in a manylinux/musllinux container providing the interpreters.
|
|
177
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
178
|
+
if: matrix.os != 'linux'
|
|
179
|
+
with:
|
|
180
|
+
python-version: |
|
|
181
|
+
3.11
|
|
182
|
+
3.14t
|
|
183
|
+
3.15
|
|
184
|
+
|
|
185
|
+
# Wheels built:
|
|
186
|
+
# - an `abi3` wheel with Python 3.11, for GIL-enabled Python 3.11 and up.
|
|
187
|
+
# - a version-specific wheel for free-threaded Python 3.14 (not supported by `abi3`).
|
|
188
|
+
# - an `abi3t` wheel with Python 3.15, for both GIL-enabled and free-threaded Python 3.15 and up.
|
|
189
|
+
# The `abi3t` wheel is built separately, as building it along with Python 3.11 results
|
|
190
|
+
# in a version-specific Python 3.11 wheel instead of an `abi3` one (as of maturin 1.15.0).
|
|
191
|
+
- name: Build abi3 and free-threaded 3.14 wheels
|
|
192
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
193
|
+
with:
|
|
194
|
+
# Keep in sync with `build-system.requires` in `pyproject.toml`:
|
|
195
|
+
maturin-version: v1.15.0
|
|
196
|
+
target: ${{ matrix.target }}
|
|
197
|
+
manylinux: ${{ matrix.manylinux }}
|
|
198
|
+
args: --release --locked --out dist --interpreter 3.11 3.14t
|
|
199
|
+
rust-toolchain: stable
|
|
200
|
+
|
|
201
|
+
- name: Build abi3t wheel
|
|
202
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
203
|
+
with:
|
|
204
|
+
# Keep in sync with `build-system.requires` in `pyproject.toml`:
|
|
205
|
+
maturin-version: v1.15.0
|
|
206
|
+
target: ${{ matrix.target }}
|
|
207
|
+
manylinux: ${{ matrix.manylinux }}
|
|
208
|
+
args: --release --locked --out dist --interpreter 3.15
|
|
209
|
+
rust-toolchain: stable
|
|
210
|
+
|
|
211
|
+
- name: Check built wheels
|
|
212
|
+
shell: bash
|
|
213
|
+
run: |
|
|
214
|
+
ls -lh dist/
|
|
215
|
+
ls dist/*-cp311-abi3-*.whl dist/*-cp314-cp314t-*.whl dist/*-cp315-abi3.abi3t-*.whl
|
|
216
|
+
|
|
217
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
218
|
+
with:
|
|
219
|
+
enable-cache: false
|
|
220
|
+
|
|
221
|
+
- run: uv sync --only-group build
|
|
222
|
+
|
|
223
|
+
- run: uv run --no-sync twine check --strict dist/*
|
|
224
|
+
|
|
225
|
+
- uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
|
|
226
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
227
|
+
with:
|
|
228
|
+
subject-path: dist/*
|
|
229
|
+
|
|
230
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
231
|
+
with:
|
|
232
|
+
name: pypi_files_${{ matrix.os }}_${{ matrix.target }}_${{ matrix.manylinux || 'native' }}
|
|
233
|
+
path: dist
|
|
234
|
+
|
|
235
|
+
test-builds:
|
|
236
|
+
name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }})
|
|
237
|
+
needs: [build]
|
|
238
|
+
strategy:
|
|
239
|
+
fail-fast: false
|
|
240
|
+
matrix:
|
|
241
|
+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest, windows-11-arm]
|
|
242
|
+
python-version: ['3.11', '3.14t', '3.15', '3.15t']
|
|
243
|
+
|
|
244
|
+
runs-on: ${{ matrix.os }}
|
|
245
|
+
steps:
|
|
246
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
247
|
+
with:
|
|
248
|
+
persist-credentials: false
|
|
249
|
+
|
|
250
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
251
|
+
with:
|
|
252
|
+
python-version: ${{ matrix.python-version }}
|
|
253
|
+
enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
|
|
254
|
+
|
|
255
|
+
- name: Get dist artifacts
|
|
256
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
257
|
+
with:
|
|
258
|
+
pattern: pypi_files_*
|
|
259
|
+
merge-multiple: true
|
|
260
|
+
path: dist
|
|
261
|
+
|
|
262
|
+
- run: uv sync --only-dev
|
|
263
|
+
- run: uv pip install regexrs-py --no-index --no-deps --find-links dist --force-reinstall
|
|
264
|
+
- run: uv run --no-sync pytest
|
|
265
|
+
- run: uv run --no-sync python -c "import sys, regex_rs._regex_rs as m; print(sys.version, m.__file__, m.REGEX_VERSION)"
|
|
266
|
+
|
|
267
|
+
check: # This job does nothing and is only used for the branch protection
|
|
268
|
+
if: always()
|
|
269
|
+
outputs:
|
|
270
|
+
result: ${{ steps.all-green.outputs.result }}
|
|
271
|
+
needs: [tests, rust-tests, msrv, docs, build-sdist, test-builds]
|
|
272
|
+
runs-on: ubuntu-latest
|
|
273
|
+
|
|
274
|
+
steps:
|
|
275
|
+
- name: Decide whether the needed jobs succeeded or failed
|
|
276
|
+
uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
|
|
277
|
+
id: all-green
|
|
278
|
+
with:
|
|
279
|
+
jobs: ${{ toJSON(needs) }}
|
|
280
|
+
|
|
281
|
+
release:
|
|
282
|
+
needs: [check]
|
|
283
|
+
if: needs.check.outputs.result == 'success' && startsWith(github.ref, 'refs/tags/')
|
|
284
|
+
runs-on: ubuntu-latest
|
|
285
|
+
environment: release
|
|
286
|
+
|
|
287
|
+
permissions:
|
|
288
|
+
id-token: write
|
|
289
|
+
attestations: read
|
|
290
|
+
|
|
291
|
+
steps:
|
|
292
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
293
|
+
with:
|
|
294
|
+
persist-credentials: false
|
|
295
|
+
|
|
296
|
+
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
297
|
+
with:
|
|
298
|
+
enable-cache: false
|
|
299
|
+
|
|
300
|
+
- run: uv sync --only-group build
|
|
301
|
+
|
|
302
|
+
- name: Check the tag matches the package version
|
|
303
|
+
run: |
|
|
304
|
+
VERSION=$(cargo metadata --format-version 1 --no-deps --frozen --quiet --offline | jq -r '.packages[0].version')
|
|
305
|
+
if [ "$GITHUB_REF_NAME" != "v$VERSION" ]; then
|
|
306
|
+
echo "Tag $GITHUB_REF_NAME does not match the package version (v$VERSION)"
|
|
307
|
+
exit 1
|
|
308
|
+
fi
|
|
309
|
+
|
|
310
|
+
- name: Get dist artifacts
|
|
311
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
312
|
+
with:
|
|
313
|
+
pattern: pypi_files_*
|
|
314
|
+
merge-multiple: true
|
|
315
|
+
path: dist
|
|
316
|
+
|
|
317
|
+
- name: Verify dist artifacts provenance
|
|
318
|
+
run: |
|
|
319
|
+
for f in dist/*; do
|
|
320
|
+
gh attestation verify "$f" \
|
|
321
|
+
--repo "$GITHUB_REPOSITORY" \
|
|
322
|
+
--signer-workflow "$GITHUB_REPOSITORY/.github/workflows/ci.yml" \
|
|
323
|
+
--source-ref "$GITHUB_REF" \
|
|
324
|
+
--source-digest "$GITHUB_SHA" \
|
|
325
|
+
--deny-self-hosted-runners
|
|
326
|
+
done
|
|
327
|
+
env:
|
|
328
|
+
GH_TOKEN: ${{ github.token }}
|
|
329
|
+
|
|
330
|
+
- name: Test wheels integrity
|
|
331
|
+
run: |
|
|
332
|
+
for whl in dist/*.whl; do unzip -qt "$whl"; done
|
|
333
|
+
uv run --no-sync twine check --strict dist/*
|
|
334
|
+
|
|
335
|
+
- name: Upload package to PyPI
|
|
336
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
337
|
+
with:
|
|
338
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
name: lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- '**'
|
|
9
|
+
pull_request: {}
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
prek:
|
|
16
|
+
name: Run prek pre-commit hooks
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
|
+
with:
|
|
21
|
+
persist-credentials: false
|
|
22
|
+
|
|
23
|
+
- uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0
|
|
24
|
+
|
|
25
|
+
ruff-format:
|
|
26
|
+
name: Check code formatting with Ruff
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
30
|
+
with:
|
|
31
|
+
persist-credentials: false
|
|
32
|
+
|
|
33
|
+
- name: Set up Python 3.15
|
|
34
|
+
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
35
|
+
with:
|
|
36
|
+
python-version: '3.15'
|
|
37
|
+
enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
|
|
38
|
+
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: uv sync --group dev
|
|
41
|
+
|
|
42
|
+
- name: Run Ruff formatter
|
|
43
|
+
run: uv run ruff format --diff
|
|
44
|
+
|
|
45
|
+
ruff-check:
|
|
46
|
+
name: Check code linting with Ruff
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
50
|
+
with:
|
|
51
|
+
persist-credentials: false
|
|
52
|
+
|
|
53
|
+
- name: Set up Python 3.15
|
|
54
|
+
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
55
|
+
with:
|
|
56
|
+
python-version: '3.15'
|
|
57
|
+
enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: uv sync --group dev
|
|
61
|
+
|
|
62
|
+
- name: Run Ruff linter
|
|
63
|
+
run: uv run ruff check --output-format=github
|
|
64
|
+
|
|
65
|
+
typecheck:
|
|
66
|
+
name: Run typechecking with pyright
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
70
|
+
with:
|
|
71
|
+
persist-credentials: false
|
|
72
|
+
|
|
73
|
+
- name: Set up Python 3.15
|
|
74
|
+
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
75
|
+
with:
|
|
76
|
+
python-version: '3.15'
|
|
77
|
+
enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
|
|
78
|
+
|
|
79
|
+
- name: Install dependencies
|
|
80
|
+
run: uv sync --group dev
|
|
81
|
+
|
|
82
|
+
- name: Run pyright
|
|
83
|
+
run: uv run pyright
|
|
84
|
+
|
|
85
|
+
rustfmt:
|
|
86
|
+
name: Check Rust formatting with rustfmt
|
|
87
|
+
runs-on: ubuntu-latest
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
90
|
+
with:
|
|
91
|
+
persist-credentials: false
|
|
92
|
+
|
|
93
|
+
- name: Run rustfmt
|
|
94
|
+
run: cargo fmt --check
|
|
95
|
+
|
|
96
|
+
clippy:
|
|
97
|
+
name: Check Rust linting with clippy
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
steps:
|
|
100
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
101
|
+
with:
|
|
102
|
+
persist-credentials: false
|
|
103
|
+
|
|
104
|
+
- name: Run clippy
|
|
105
|
+
run: cargo clippy --locked --all-targets -- --deny warnings
|
|
106
|
+
|
|
107
|
+
stubs:
|
|
108
|
+
name: Check type stubs are up to date
|
|
109
|
+
runs-on: ubuntu-latest
|
|
110
|
+
steps:
|
|
111
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
112
|
+
with:
|
|
113
|
+
persist-credentials: false
|
|
114
|
+
|
|
115
|
+
# Stubs depend on the Python version, and are generated with the oldest supported one.
|
|
116
|
+
- name: Set up Python 3.11
|
|
117
|
+
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
118
|
+
with:
|
|
119
|
+
python-version: '3.11'
|
|
120
|
+
enable-cache: true # zizmor: ignore[cache-poisoning] (Job does not produce release artifacts and does not have sensitive permissions)
|
|
121
|
+
|
|
122
|
+
- name: Install dependencies
|
|
123
|
+
run: uv sync --group dev
|
|
124
|
+
|
|
125
|
+
- name: Generate stubs
|
|
126
|
+
run: ./scripts/generate-stubs.sh
|
|
127
|
+
|
|
128
|
+
- name: Check for differences
|
|
129
|
+
run: git diff --exit-code python/regex_rs/_regex_rs.pyi
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
## Rust (adapted from https://github.com/github/gitignore/blob/main/Rust.gitignore):
|
|
2
|
+
|
|
3
|
+
# Generated by Cargo
|
|
4
|
+
# will have compiled files and executables
|
|
5
|
+
debug
|
|
6
|
+
target
|
|
7
|
+
|
|
8
|
+
# These are backup files generated by rustfmt
|
|
9
|
+
**/*.rs.bk
|
|
10
|
+
|
|
11
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
12
|
+
*.pdb
|
|
13
|
+
|
|
14
|
+
# Generated by cargo mutants
|
|
15
|
+
# Contains mutation testing data
|
|
16
|
+
**/mutants.out*/
|
|
17
|
+
|
|
18
|
+
# rustc will dump stack traces when hitting an internal compiler error to PWD
|
|
19
|
+
rustc-ice-*.txt
|
|
20
|
+
|
|
21
|
+
## Python (adapted from https://github.com/github/gitignore/blob/main/Python.gitignore):
|
|
22
|
+
|
|
23
|
+
# Byte-compiled / optimized / DLL files
|
|
24
|
+
__pycache__/
|
|
25
|
+
*.py[codz]
|
|
26
|
+
*$py.class
|
|
27
|
+
|
|
28
|
+
# C extensions
|
|
29
|
+
*.so
|
|
30
|
+
|
|
31
|
+
# Distribution / packaging
|
|
32
|
+
.Python
|
|
33
|
+
build/
|
|
34
|
+
develop-eggs/
|
|
35
|
+
dist/
|
|
36
|
+
downloads/
|
|
37
|
+
eggs/
|
|
38
|
+
.eggs/
|
|
39
|
+
lib/
|
|
40
|
+
lib64/
|
|
41
|
+
parts/
|
|
42
|
+
sdist/
|
|
43
|
+
var/
|
|
44
|
+
wheels/
|
|
45
|
+
share/python-wheels/
|
|
46
|
+
*.egg-info/
|
|
47
|
+
.installed.cfg
|
|
48
|
+
*.egg
|
|
49
|
+
MANIFEST
|
|
50
|
+
|
|
51
|
+
# PyInstaller
|
|
52
|
+
# Usually these files are written by a python script from a template
|
|
53
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
54
|
+
*.manifest
|
|
55
|
+
*.spec
|
|
56
|
+
|
|
57
|
+
# Installer logs
|
|
58
|
+
pip-log.txt
|
|
59
|
+
pip-delete-this-directory.txt
|
|
60
|
+
|
|
61
|
+
# Unit test / coverage reports
|
|
62
|
+
htmlcov/
|
|
63
|
+
.tox/
|
|
64
|
+
.nox/
|
|
65
|
+
.coverage
|
|
66
|
+
.coverage.*
|
|
67
|
+
.cache
|
|
68
|
+
nosetests.xml
|
|
69
|
+
coverage.xml
|
|
70
|
+
*.cover
|
|
71
|
+
*.py.cover
|
|
72
|
+
*.lcov
|
|
73
|
+
.hypothesis/
|
|
74
|
+
.pytest_cache/
|
|
75
|
+
cover/
|
|
76
|
+
|
|
77
|
+
# Translations
|
|
78
|
+
*.mo
|
|
79
|
+
*.pot
|
|
80
|
+
|
|
81
|
+
# Django stuff:
|
|
82
|
+
*.log
|
|
83
|
+
local_settings.py
|
|
84
|
+
db.sqlite3
|
|
85
|
+
db.sqlite3-journal
|
|
86
|
+
|
|
87
|
+
# Flask stuff:
|
|
88
|
+
instance/
|
|
89
|
+
.webassets-cache
|
|
90
|
+
|
|
91
|
+
# Scrapy stuff:
|
|
92
|
+
.scrapy
|
|
93
|
+
|
|
94
|
+
# Sphinx documentation
|
|
95
|
+
docs/_build/
|
|
96
|
+
|
|
97
|
+
# PyBuilder
|
|
98
|
+
.pybuilder/
|
|
99
|
+
target/
|
|
100
|
+
|
|
101
|
+
# Jupyter Notebook
|
|
102
|
+
.ipynb_checkpoints
|
|
103
|
+
|
|
104
|
+
# IPython
|
|
105
|
+
profile_default/
|
|
106
|
+
ipython_config.py
|
|
107
|
+
|
|
108
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
109
|
+
__pypackages__/
|
|
110
|
+
|
|
111
|
+
# Environments
|
|
112
|
+
.env
|
|
113
|
+
.envrc
|
|
114
|
+
.venv
|
|
115
|
+
env/
|
|
116
|
+
venv/
|
|
117
|
+
ENV/
|
|
118
|
+
env.bak/
|
|
119
|
+
venv.bak/
|
|
120
|
+
|
|
121
|
+
# Ruff stuff:
|
|
122
|
+
.ruff_cache/
|
|
123
|
+
|
|
124
|
+
# PyPI configuration file
|
|
125
|
+
.pypirc
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# .readthedocs.yaml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.com/platform/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# Set the OS, Python version and other tools you might need
|
|
9
|
+
build:
|
|
10
|
+
os: ubuntu-24.04
|
|
11
|
+
tools:
|
|
12
|
+
python: '3.14'
|
|
13
|
+
# Needed to build the extension module when installing the project
|
|
14
|
+
rust: latest
|
|
15
|
+
# https://docs.readthedocs.com/platform/stable/build-customization.html#install-dependencies-with-uv
|
|
16
|
+
jobs:
|
|
17
|
+
pre_create_environment:
|
|
18
|
+
- asdf plugin add uv
|
|
19
|
+
- asdf install uv latest
|
|
20
|
+
- asdf global uv latest
|
|
21
|
+
create_environment:
|
|
22
|
+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
|
|
23
|
+
install:
|
|
24
|
+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
|
|
25
|
+
|
|
26
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
27
|
+
sphinx:
|
|
28
|
+
configuration: docs/source/conf.py
|
|
29
|
+
|
|
30
|
+
# Optionally build your docs in additional formats such as PDF and ePub
|
|
31
|
+
formats:
|
|
32
|
+
- pdf
|
|
33
|
+
- epub
|