ffroute 0.1.1__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.
@@ -0,0 +1,121 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build-wheels:
13
+ name: Wheel ${{ matrix.os }} / ${{ matrix.target }} / ${{ matrix.manylinux || 'auto' }}
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ include:
19
+ # Linux glibc (manylinux)
20
+ - os: ubuntu-24.04
21
+ target: x86_64-unknown-linux-gnu
22
+ manylinux: auto
23
+ - os: ubuntu-24.04
24
+ target: aarch64-unknown-linux-gnu
25
+ manylinux: auto
26
+ # Linux musl (musllinux) — Alpine/distroless
27
+ - os: ubuntu-24.04
28
+ target: x86_64-unknown-linux-musl
29
+ manylinux: musllinux_1_2
30
+ - os: ubuntu-24.04
31
+ target: aarch64-unknown-linux-musl
32
+ manylinux: musllinux_1_2
33
+ # macOS — both targets built on macos-14 (arm64). The x86_64 wheel
34
+ # is cross-compiled (maturin-action installs the target via rustup).
35
+ # macos-13 is being phased out by GitHub and was hanging on v0.1.0.
36
+ - os: macos-14
37
+ target: x86_64-apple-darwin
38
+ - os: macos-14
39
+ target: aarch64-apple-darwin
40
+ # Windows
41
+ - os: windows-2022
42
+ target: x86_64-pc-windows-msvc
43
+
44
+ steps:
45
+ - uses: actions/checkout@v5
46
+ with:
47
+ fetch-depth: 0
48
+
49
+ - name: Set up Python
50
+ uses: actions/setup-python@v6
51
+ with:
52
+ python-version: '3.13'
53
+
54
+ - name: Build wheels
55
+ uses: PyO3/maturin-action@v1.49.3
56
+ with:
57
+ target: ${{ matrix.target }}
58
+ manylinux: ${{ matrix.manylinux || 'auto' }}
59
+ args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
60
+
61
+ - name: Upload wheels
62
+ uses: actions/upload-artifact@v4
63
+ with:
64
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }}
65
+ path: dist/*.whl
66
+
67
+ build-sdist:
68
+ name: Build sdist
69
+ runs-on: ubuntu-24.04
70
+ steps:
71
+ - uses: actions/checkout@v5
72
+ with:
73
+ fetch-depth: 0
74
+
75
+ - name: Build sdist
76
+ uses: PyO3/maturin-action@v1.49.3
77
+ with:
78
+ command: sdist
79
+ args: --out dist
80
+
81
+ - name: Upload sdist
82
+ uses: actions/upload-artifact@v4
83
+ with:
84
+ name: sdist
85
+ path: dist/*.tar.gz
86
+
87
+ publish-to-pypi:
88
+ name: Publish to PyPI
89
+ if: github.event_name == 'release' && github.event.action == 'published'
90
+ needs: [build-wheels, build-sdist]
91
+ runs-on: ubuntu-24.04
92
+ environment:
93
+ name: pypi
94
+ url: https://pypi.org/p/ffroute
95
+ permissions:
96
+ id-token: write
97
+ steps:
98
+ - uses: actions/download-artifact@v4
99
+ with:
100
+ path: dist/
101
+ merge-multiple: true
102
+ - uses: pypa/gh-action-pypi-publish@release/v1
103
+
104
+ publish-to-testpypi:
105
+ name: Publish to TestPyPI
106
+ if: github.event_name == 'workflow_dispatch'
107
+ needs: [build-wheels, build-sdist]
108
+ runs-on: ubuntu-24.04
109
+ environment:
110
+ name: testpypi
111
+ url: https://test.pypi.org/p/ffroute
112
+ permissions:
113
+ id-token: write
114
+ steps:
115
+ - uses: actions/download-artifact@v4
116
+ with:
117
+ path: dist/
118
+ merge-multiple: true
119
+ - uses: pypa/gh-action-pypi-publish@release/v1
120
+ with:
121
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,96 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: tests-${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ test:
18
+ name: Test ${{ matrix.os }} / Python ${{ matrix.python-version }}
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ os: [ubuntu-24.04]
24
+ python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
25
+ include:
26
+ - os: macos-14
27
+ python-version: '3.13'
28
+ - os: macos-14
29
+ python-version: '3.14'
30
+ - os: windows-2022
31
+ python-version: '3.13'
32
+ - os: windows-2022
33
+ python-version: '3.14'
34
+
35
+ steps:
36
+ - uses: actions/checkout@v5
37
+
38
+ - name: Install uv
39
+ uses: astral-sh/setup-uv@v5
40
+ with:
41
+ enable-cache: true
42
+ python-version: ${{ matrix.python-version }}
43
+
44
+ - name: Install Rust toolchain
45
+ uses: dtolnay/rust-toolchain@stable
46
+
47
+ - name: Cache Rust build artifacts
48
+ uses: Swatinem/rust-cache@v2
49
+ with:
50
+ shared-key: tests-${{ matrix.os }}
51
+
52
+ - name: Install dev dependencies
53
+ run: uv sync --all-groups
54
+
55
+ - name: Build Rust extension
56
+ run: uv run maturin develop --release
57
+
58
+ - name: Run Python tests
59
+ run: uv run pytest
60
+
61
+ lint:
62
+ name: Lint
63
+ runs-on: ubuntu-24.04
64
+ steps:
65
+ - uses: actions/checkout@v5
66
+
67
+ - name: Install uv
68
+ uses: astral-sh/setup-uv@v5
69
+ with:
70
+ enable-cache: true
71
+ python-version: '3.13'
72
+
73
+ - name: Install Rust toolchain
74
+ uses: dtolnay/rust-toolchain@stable
75
+ with:
76
+ components: rustfmt, clippy
77
+
78
+ - name: Cache Rust build artifacts
79
+ uses: Swatinem/rust-cache@v2
80
+ with:
81
+ shared-key: lint
82
+
83
+ - name: Install dev dependencies
84
+ run: uv sync --all-groups
85
+
86
+ - name: Ruff check
87
+ run: uv run ruff check .
88
+
89
+ - name: Ruff format check
90
+ run: uv run ruff format --check .
91
+
92
+ - name: Cargo fmt check
93
+ run: cargo fmt --all -- --check
94
+
95
+ - name: Cargo clippy
96
+ run: cargo clippy --all-targets -- -D warnings
@@ -0,0 +1,39 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info/
8
+
9
+ # Virtual environments
10
+ .venv/
11
+
12
+ # Caches
13
+ .mypy_cache/
14
+ .pytest_cache/
15
+ .ruff_cache/
16
+
17
+ # Coverage
18
+ .coverage
19
+ .coverage.*
20
+ htmlcov/
21
+
22
+ # Rust / maturin build artifacts
23
+ target/
24
+ *.so
25
+ *.pyd
26
+ *.dylib
27
+
28
+ # Worktree scratch
29
+ tmp/
30
+
31
+ # Benchmark cache (downloaded OpenAPI specs)
32
+ benchmarks/.cache/
33
+
34
+ # Editor / OS
35
+ .idea/
36
+ .vscode/
37
+ .claude/
38
+ .DS_Store
39
+ *.swp
@@ -0,0 +1,41 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0
6
+ hooks:
7
+ - id: check-yaml
8
+ - id: check-toml
9
+ - id: check-json
10
+ - id: check-merge-conflict
11
+ - id: check-case-conflict
12
+ - id: end-of-file-fixer
13
+ - id: trailing-whitespace
14
+ - id: mixed-line-ending
15
+
16
+ - repo: https://github.com/astral-sh/ruff-pre-commit
17
+ rev: v0.14.2
18
+ hooks:
19
+ - id: ruff-check
20
+ args: [--fix, --exit-non-zero-on-fix]
21
+ - id: ruff-format
22
+
23
+ - repo: https://github.com/astral-sh/uv-pre-commit
24
+ rev: 0.9.6
25
+ hooks:
26
+ - id: uv-lock
27
+
28
+ - repo: local
29
+ hooks:
30
+ - id: cargo-fmt
31
+ name: cargo fmt
32
+ entry: cargo fmt --all --
33
+ language: system
34
+ types: [rust]
35
+ pass_filenames: false
36
+ - id: cargo-clippy
37
+ name: cargo clippy
38
+ entry: cargo clippy --all-targets -- -D warnings
39
+ language: system
40
+ types: [rust]
41
+ pass_filenames: false
@@ -0,0 +1,217 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.4"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
19
+
20
+ [[package]]
21
+ name = "ffroute"
22
+ version = "0.1.1"
23
+ dependencies = [
24
+ "pyo3",
25
+ "regex",
26
+ ]
27
+
28
+ [[package]]
29
+ name = "heck"
30
+ version = "0.5.0"
31
+ source = "registry+https://github.com/rust-lang/crates.io-index"
32
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
33
+
34
+ [[package]]
35
+ name = "indoc"
36
+ version = "2.0.7"
37
+ source = "registry+https://github.com/rust-lang/crates.io-index"
38
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
39
+ dependencies = [
40
+ "rustversion",
41
+ ]
42
+
43
+ [[package]]
44
+ name = "libc"
45
+ version = "0.2.186"
46
+ source = "registry+https://github.com/rust-lang/crates.io-index"
47
+ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
48
+
49
+ [[package]]
50
+ name = "memchr"
51
+ version = "2.8.2"
52
+ source = "registry+https://github.com/rust-lang/crates.io-index"
53
+ checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4"
54
+
55
+ [[package]]
56
+ name = "memoffset"
57
+ version = "0.9.1"
58
+ source = "registry+https://github.com/rust-lang/crates.io-index"
59
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
60
+ dependencies = [
61
+ "autocfg",
62
+ ]
63
+
64
+ [[package]]
65
+ name = "once_cell"
66
+ version = "1.21.4"
67
+ source = "registry+https://github.com/rust-lang/crates.io-index"
68
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
69
+
70
+ [[package]]
71
+ name = "portable-atomic"
72
+ version = "1.13.1"
73
+ source = "registry+https://github.com/rust-lang/crates.io-index"
74
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
75
+
76
+ [[package]]
77
+ name = "proc-macro2"
78
+ version = "1.0.106"
79
+ source = "registry+https://github.com/rust-lang/crates.io-index"
80
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
81
+ dependencies = [
82
+ "unicode-ident",
83
+ ]
84
+
85
+ [[package]]
86
+ name = "pyo3"
87
+ version = "0.26.0"
88
+ source = "registry+https://github.com/rust-lang/crates.io-index"
89
+ checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
90
+ dependencies = [
91
+ "indoc",
92
+ "libc",
93
+ "memoffset",
94
+ "once_cell",
95
+ "portable-atomic",
96
+ "pyo3-build-config",
97
+ "pyo3-ffi",
98
+ "pyo3-macros",
99
+ "unindent",
100
+ ]
101
+
102
+ [[package]]
103
+ name = "pyo3-build-config"
104
+ version = "0.26.0"
105
+ source = "registry+https://github.com/rust-lang/crates.io-index"
106
+ checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
107
+ dependencies = [
108
+ "target-lexicon",
109
+ ]
110
+
111
+ [[package]]
112
+ name = "pyo3-ffi"
113
+ version = "0.26.0"
114
+ source = "registry+https://github.com/rust-lang/crates.io-index"
115
+ checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
116
+ dependencies = [
117
+ "libc",
118
+ "pyo3-build-config",
119
+ ]
120
+
121
+ [[package]]
122
+ name = "pyo3-macros"
123
+ version = "0.26.0"
124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
125
+ checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
126
+ dependencies = [
127
+ "proc-macro2",
128
+ "pyo3-macros-backend",
129
+ "quote",
130
+ "syn",
131
+ ]
132
+
133
+ [[package]]
134
+ name = "pyo3-macros-backend"
135
+ version = "0.26.0"
136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
137
+ checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
138
+ dependencies = [
139
+ "heck",
140
+ "proc-macro2",
141
+ "pyo3-build-config",
142
+ "quote",
143
+ "syn",
144
+ ]
145
+
146
+ [[package]]
147
+ name = "quote"
148
+ version = "1.0.45"
149
+ source = "registry+https://github.com/rust-lang/crates.io-index"
150
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
151
+ dependencies = [
152
+ "proc-macro2",
153
+ ]
154
+
155
+ [[package]]
156
+ name = "regex"
157
+ version = "1.12.4"
158
+ source = "registry+https://github.com/rust-lang/crates.io-index"
159
+ checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba"
160
+ dependencies = [
161
+ "aho-corasick",
162
+ "memchr",
163
+ "regex-automata",
164
+ "regex-syntax",
165
+ ]
166
+
167
+ [[package]]
168
+ name = "regex-automata"
169
+ version = "0.4.14"
170
+ source = "registry+https://github.com/rust-lang/crates.io-index"
171
+ checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
172
+ dependencies = [
173
+ "aho-corasick",
174
+ "memchr",
175
+ "regex-syntax",
176
+ ]
177
+
178
+ [[package]]
179
+ name = "regex-syntax"
180
+ version = "0.8.11"
181
+ source = "registry+https://github.com/rust-lang/crates.io-index"
182
+ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
183
+
184
+ [[package]]
185
+ name = "rustversion"
186
+ version = "1.0.22"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
189
+
190
+ [[package]]
191
+ name = "syn"
192
+ version = "2.0.118"
193
+ source = "registry+https://github.com/rust-lang/crates.io-index"
194
+ checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
195
+ dependencies = [
196
+ "proc-macro2",
197
+ "quote",
198
+ "unicode-ident",
199
+ ]
200
+
201
+ [[package]]
202
+ name = "target-lexicon"
203
+ version = "0.13.5"
204
+ source = "registry+https://github.com/rust-lang/crates.io-index"
205
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
206
+
207
+ [[package]]
208
+ name = "unicode-ident"
209
+ version = "1.0.24"
210
+ source = "registry+https://github.com/rust-lang/crates.io-index"
211
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
212
+
213
+ [[package]]
214
+ name = "unindent"
215
+ version = "0.2.4"
216
+ source = "registry+https://github.com/rust-lang/crates.io-index"
217
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
@@ -0,0 +1,27 @@
1
+ [package]
2
+ name = "ffroute"
3
+ version = "0.1.1"
4
+ edition = "2021"
5
+ description = "Starlette-compatible URL route matcher as a native Python extension."
6
+ license = "MIT"
7
+ repository = "https://github.com/jirikuncar/ffroute"
8
+ homepage = "https://github.com/jirikuncar/ffroute"
9
+ readme = "README.md"
10
+ keywords = ["starlette", "fastapi", "routing", "pyo3", "router"]
11
+ categories = ["network-programming", "web-programming"]
12
+ publish = false
13
+
14
+ [lib]
15
+ name = "_core"
16
+ crate-type = ["cdylib", "rlib"]
17
+
18
+ [dependencies]
19
+ pyo3 = { version = "0.26", features = ["extension-module"] }
20
+ regex = "1"
21
+
22
+ [profile.release]
23
+ opt-level = 3
24
+ lto = "fat"
25
+ codegen-units = 1
26
+ panic = "abort"
27
+ strip = "symbols"
ffroute-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jiri Kuncar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ffroute-0.1.1/Makefile ADDED
@@ -0,0 +1,71 @@
1
+ .PHONY: help
2
+ help:
3
+ @echo "Available targets:"
4
+ @echo ""
5
+ @echo "Development:"
6
+ @echo " install - Install dev dependencies with uv"
7
+ @echo " build - Build the Rust extension (dev mode)"
8
+ @echo " build-release - Build the Rust extension (release mode)"
9
+ @echo " pre-commit-install - Install prek-managed pre-commit hooks"
10
+ @echo " pre-commit - Run prek on all files"
11
+ @echo ""
12
+ @echo "Quality:"
13
+ @echo " lint - Run ruff check + clippy"
14
+ @echo " format - Run ruff format + cargo fmt"
15
+ @echo " check - Run ruff check + ruff format check + clippy + cargo fmt check"
16
+ @echo ""
17
+ @echo "Testing:"
18
+ @echo " test - Run pytest"
19
+ @echo ""
20
+ @echo "Release:"
21
+ @echo " sdist - Build the source distribution"
22
+ @echo " wheel - Build a wheel for the current platform"
23
+
24
+ .PHONY: install
25
+ install:
26
+ uv sync --all-groups
27
+
28
+ .PHONY: build
29
+ build:
30
+ uv run --no-sync maturin develop
31
+
32
+ .PHONY: build-release
33
+ build-release:
34
+ uv run --no-sync maturin develop --release
35
+
36
+ .PHONY: pre-commit-install
37
+ pre-commit-install:
38
+ uv run prek install
39
+
40
+ .PHONY: pre-commit
41
+ pre-commit:
42
+ uv run prek run --all-files
43
+
44
+ .PHONY: lint
45
+ lint:
46
+ uv run ruff check --fix .
47
+ cargo clippy --all-targets -- -D warnings
48
+
49
+ .PHONY: format
50
+ format:
51
+ uv run ruff format .
52
+ cargo fmt --all
53
+
54
+ .PHONY: check
55
+ check:
56
+ uv run ruff check .
57
+ uv run ruff format --check .
58
+ cargo fmt --all -- --check
59
+ cargo clippy --all-targets -- -D warnings
60
+
61
+ .PHONY: test
62
+ test:
63
+ uv run pytest
64
+
65
+ .PHONY: sdist
66
+ sdist:
67
+ uv run maturin sdist --out dist
68
+
69
+ .PHONY: wheel
70
+ wheel:
71
+ uv run maturin build --release --out dist