ignyx 2.8.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.
- ignyx-2.8.0/.coverage +0 -0
- ignyx-2.8.0/.github/ISSUE_TEMPLATE/bug_report.md +10 -0
- ignyx-2.8.0/.github/ISSUE_TEMPLATE/feature_request.md +8 -0
- ignyx-2.8.0/.github/PULL_REQUEST_TEMPLATE.md +5 -0
- ignyx-2.8.0/.github/workflows/CI.yml +56 -0
- ignyx-2.8.0/.github/workflows/docs.yml +16 -0
- ignyx-2.8.0/.github/workflows/release.yml +102 -0
- ignyx-2.8.0/.gitignore +36 -0
- ignyx-2.8.0/.markdownlint.json +16 -0
- ignyx-2.8.0/BENCHMARK.md +58 -0
- ignyx-2.8.0/CHANGELOG.md +127 -0
- ignyx-2.8.0/CODE_OF_CONDUCT.md +72 -0
- ignyx-2.8.0/CONTRIBUTING.md +30 -0
- ignyx-2.8.0/Cargo.lock +1393 -0
- ignyx-2.8.0/Cargo.toml +37 -0
- ignyx-2.8.0/LICENSE +21 -0
- ignyx-2.8.0/PKG-INFO +227 -0
- ignyx-2.8.0/README.md +190 -0
- ignyx-2.8.0/SECURITY.md +14 -0
- ignyx-2.8.0/benchmarks/async_bench.py +24 -0
- ignyx-2.8.0/benchmarks/bench.py +252 -0
- ignyx-2.8.0/benchmarks/fastapi_bench.py +8 -0
- ignyx-2.8.0/benchmarks/fastapi_honest.py +17 -0
- ignyx-2.8.0/benchmarks/flask_bench.py +11 -0
- ignyx-2.8.0/benchmarks/honest_bench.py +19 -0
- ignyx-2.8.0/benchmarks/minimal_arm.py +9 -0
- ignyx-2.8.0/benchmarks/minimal_sync.py +15 -0
- ignyx-2.8.0/benchmarks/native_fastapi_app.py +26 -0
- ignyx-2.8.0/benchmarks/native_ignyx_app.py +25 -0
- ignyx-2.8.0/benchmarks/post.lua +3 -0
- ignyx-2.8.0/benchmarks/priority1_test.py +28 -0
- ignyx-2.8.0/benchmarks/results/README.md +2 -0
- ignyx-2.8.0/benchmarks/run_arm.sh +7 -0
- ignyx-2.8.0/benchmarks/run_async_bench.sh +17 -0
- ignyx-2.8.0/benchmarks/run_benchmark.py +60 -0
- ignyx-2.8.0/benchmarks/run_benchmarks.sh +42 -0
- ignyx-2.8.0/benchmarks/starlette_bench.py +14 -0
- ignyx-2.8.0/docs/assets/ignyx-logo.png +0 -0
- ignyx-2.8.0/docs/benchmarks.md +8 -0
- ignyx-2.8.0/docs/dependency_injection.md +97 -0
- ignyx-2.8.0/docs/deployment.md +84 -0
- ignyx-2.8.0/docs/error_handling.md +76 -0
- ignyx-2.8.0/docs/index.md +2 -0
- ignyx-2.8.0/docs/lifespan.md +67 -0
- ignyx-2.8.0/docs/middleware.md +117 -0
- ignyx-2.8.0/docs/quickstart.md +17 -0
- ignyx-2.8.0/docs/request.md +87 -0
- ignyx-2.8.0/docs/response.md +121 -0
- ignyx-2.8.0/docs/routing.md +113 -0
- ignyx-2.8.0/docs/security.md +100 -0
- ignyx-2.8.0/docs/static_files.md +53 -0
- ignyx-2.8.0/docs/testing.md +99 -0
- ignyx-2.8.0/docs/validation.md +109 -0
- ignyx-2.8.0/docs/websockets.md +118 -0
- ignyx-2.8.0/examples/database_lifespan_example.py +251 -0
- ignyx-2.8.0/examples/demo.py +72 -0
- ignyx-2.8.0/examples/dependency_example.py +15 -0
- ignyx-2.8.0/examples/file_upload_example.py +10 -0
- ignyx-2.8.0/examples/hello.py +15 -0
- ignyx-2.8.0/examples/jwt_example.py +91 -0
- ignyx-2.8.0/examples/middleware_example.py +16 -0
- ignyx-2.8.0/examples/pydantic_example.py +22 -0
- ignyx-2.8.0/examples/router_example.py +14 -0
- ignyx-2.8.0/examples/websocket_example.py +12 -0
- ignyx-2.8.0/mkdocs.yml +29 -0
- ignyx-2.8.0/pyproject.toml +74 -0
- ignyx-2.8.0/python/ignyx/__init__.py +61 -0
- ignyx-2.8.0/python/ignyx/app.py +443 -0
- ignyx-2.8.0/python/ignyx/asgi.py +646 -0
- ignyx-2.8.0/python/ignyx/cli.py +426 -0
- ignyx-2.8.0/python/ignyx/depends.py +230 -0
- ignyx-2.8.0/python/ignyx/exceptions.py +11 -0
- ignyx-2.8.0/python/ignyx/middleware.py +173 -0
- ignyx-2.8.0/python/ignyx/openapi.py +303 -0
- ignyx-2.8.0/python/ignyx/py.typed +0 -0
- ignyx-2.8.0/python/ignyx/reload.py +37 -0
- ignyx-2.8.0/python/ignyx/request.py +131 -0
- ignyx-2.8.0/python/ignyx/responses.py +203 -0
- ignyx-2.8.0/python/ignyx/router.py +72 -0
- ignyx-2.8.0/python/ignyx/security.py +109 -0
- ignyx-2.8.0/python/ignyx/staticfiles.py +24 -0
- ignyx-2.8.0/python/ignyx/testclient.py +61 -0
- ignyx-2.8.0/python/ignyx/uploads.py +15 -0
- ignyx-2.8.0/python/ignyx/websocket.py +59 -0
- ignyx-2.8.0/site/404.html +1036 -0
- ignyx-2.8.0/site/assets/ignyx-logo.png +0 -0
- ignyx-2.8.0/site/assets/images/favicon.png +0 -0
- ignyx-2.8.0/site/assets/javascripts/bundle.79ae519e.min.js +16 -0
- ignyx-2.8.0/site/assets/javascripts/bundle.79ae519e.min.js.map +7 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/tinyseg.js +206 -0
- ignyx-2.8.0/site/assets/javascripts/lunr/wordcut.js +6708 -0
- ignyx-2.8.0/site/assets/javascripts/workers/search.2c215733.min.js +42 -0
- ignyx-2.8.0/site/assets/javascripts/workers/search.2c215733.min.js.map +7 -0
- ignyx-2.8.0/site/assets/stylesheets/main.484c7ddc.min.css +1 -0
- ignyx-2.8.0/site/assets/stylesheets/main.484c7ddc.min.css.map +1 -0
- ignyx-2.8.0/site/assets/stylesheets/palette.ab4e12ef.min.css +1 -0
- ignyx-2.8.0/site/assets/stylesheets/palette.ab4e12ef.min.css.map +1 -0
- ignyx-2.8.0/site/benchmarks/index.html +1109 -0
- ignyx-2.8.0/site/dependency_injection/index.html +1366 -0
- ignyx-2.8.0/site/deployment/index.html +1330 -0
- ignyx-2.8.0/site/error_handling/index.html +1366 -0
- ignyx-2.8.0/site/index.html +1079 -0
- ignyx-2.8.0/site/lifespan/index.html +1360 -0
- ignyx-2.8.0/site/middleware/index.html +1403 -0
- ignyx-2.8.0/site/quickstart/index.html +1094 -0
- ignyx-2.8.0/site/request/index.html +1341 -0
- ignyx-2.8.0/site/response/index.html +1411 -0
- ignyx-2.8.0/site/routing/index.html +1440 -0
- ignyx-2.8.0/site/search/search_index.json +1 -0
- ignyx-2.8.0/site/security/index.html +1416 -0
- ignyx-2.8.0/site/sitemap.xml +67 -0
- ignyx-2.8.0/site/sitemap.xml.gz +0 -0
- ignyx-2.8.0/site/static_files/index.html +1327 -0
- ignyx-2.8.0/site/testing/index.html +1449 -0
- ignyx-2.8.0/site/validation/index.html +1360 -0
- ignyx-2.8.0/site/websockets/index.html +1510 -0
- ignyx-2.8.0/src/handler.rs +559 -0
- ignyx-2.8.0/src/lib.rs +23 -0
- ignyx-2.8.0/src/middleware.rs +230 -0
- ignyx-2.8.0/src/multipart.rs +33 -0
- ignyx-2.8.0/src/pyref.rs +7 -0
- ignyx-2.8.0/src/request.rs +221 -0
- ignyx-2.8.0/src/response.rs +62 -0
- ignyx-2.8.0/src/router.rs +118 -0
- ignyx-2.8.0/src/security.rs +192 -0
- ignyx-2.8.0/src/server.rs +1069 -0
- ignyx-2.8.0/src/websocket.rs +235 -0
- ignyx-2.8.0/static/swagger-ui.html +28 -0
- ignyx-2.8.0/tests/conftest.py +69 -0
- ignyx-2.8.0/tests/test_asgi.py +344 -0
- ignyx-2.8.0/tests/test_background_tasks.py +183 -0
- ignyx-2.8.0/tests/test_bugs.py +19 -0
- ignyx-2.8.0/tests/test_dependencies.py +68 -0
- ignyx-2.8.0/tests/test_exceptions.py +54 -0
- ignyx-2.8.0/tests/test_jwt.py +107 -0
- ignyx-2.8.0/tests/test_lifespan.py +46 -0
- ignyx-2.8.0/tests/test_middleware.py +99 -0
- ignyx-2.8.0/tests/test_openapi.py +47 -0
- ignyx-2.8.0/tests/test_p3.py +41 -0
- ignyx-2.8.0/tests/test_responses.py +22 -0
- ignyx-2.8.0/tests/test_routing.py +30 -0
- ignyx-2.8.0/tests/test_security.py +63 -0
- ignyx-2.8.0/tests/test_static.py +47 -0
- ignyx-2.8.0/tests/test_uploads.py +11 -0
- ignyx-2.8.0/tests/test_validation.py +16 -0
ignyx-2.8.0/.coverage
ADDED
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
name: Test (${{ matrix.os }}, Python ${{ matrix.python }})
|
|
10
|
+
runs-on: ${{ matrix.os }}
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
15
|
+
python: ['3.12', '3.13']
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python }}
|
|
21
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
22
|
+
- uses: Swatinem/rust-cache@v2
|
|
23
|
+
- name: Build and test
|
|
24
|
+
shell: bash
|
|
25
|
+
run: |
|
|
26
|
+
python -m venv .venv
|
|
27
|
+
# Correct cross-platform activation
|
|
28
|
+
if [ "$RUNNER_OS" == "Windows" ]; then
|
|
29
|
+
source .venv/Scripts/activate
|
|
30
|
+
else
|
|
31
|
+
source .venv/bin/activate
|
|
32
|
+
fi
|
|
33
|
+
python -m pip install --upgrade pip
|
|
34
|
+
pip install maturin pytest pydantic httpx websockets python-multipart pytest-cov
|
|
35
|
+
maturin develop --release
|
|
36
|
+
pytest tests/ -v --tb=short --cov=python/ignyx --cov-report=term-missing
|
|
37
|
+
|
|
38
|
+
lint:
|
|
39
|
+
name: Lint
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
44
|
+
with:
|
|
45
|
+
components: rustfmt, clippy
|
|
46
|
+
- uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: '3.12'
|
|
49
|
+
- name: Rust fmt check
|
|
50
|
+
run: cargo fmt --check
|
|
51
|
+
- name: Cargo clippy
|
|
52
|
+
run: cargo clippy -- -D warnings
|
|
53
|
+
- name: Python lint
|
|
54
|
+
run: |
|
|
55
|
+
pip install ruff
|
|
56
|
+
ruff check python/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
permissions:
|
|
6
|
+
contents: write
|
|
7
|
+
jobs:
|
|
8
|
+
deploy:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-python@v5
|
|
13
|
+
with:
|
|
14
|
+
python-version: '3.12'
|
|
15
|
+
- run: pip install mkdocs-material
|
|
16
|
+
- run: mkdocs gh-deploy --force
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
# ── Build binary wheels for every target ──────────────────────────────
|
|
12
|
+
build-wheels:
|
|
13
|
+
name: Build wheels (${{ matrix.target }})
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
include:
|
|
19
|
+
# ── Linux (glibc / manylinux) ──
|
|
20
|
+
- os: ubuntu-latest
|
|
21
|
+
target: x86_64-unknown-linux-gnu
|
|
22
|
+
- os: ubuntu-latest
|
|
23
|
+
target: aarch64-unknown-linux-gnu
|
|
24
|
+
|
|
25
|
+
# ── Linux (musl / musllinux) ──
|
|
26
|
+
- os: ubuntu-latest
|
|
27
|
+
target: x86_64-unknown-linux-musl
|
|
28
|
+
- os: ubuntu-latest
|
|
29
|
+
target: aarch64-unknown-linux-musl
|
|
30
|
+
|
|
31
|
+
# ── macOS ──
|
|
32
|
+
- os: macos-latest
|
|
33
|
+
target: x86_64-apple-darwin
|
|
34
|
+
- os: macos-14
|
|
35
|
+
target: aarch64-apple-darwin
|
|
36
|
+
|
|
37
|
+
# ── Windows ──
|
|
38
|
+
- os: windows-latest
|
|
39
|
+
target: x86_64-pc-windows-msvc
|
|
40
|
+
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- name: Set up QEMU (for aarch64 cross-compilation)
|
|
45
|
+
if: contains(matrix.target, 'aarch64') && runner.os == 'Linux'
|
|
46
|
+
uses: docker/setup-qemu-action@v3
|
|
47
|
+
with:
|
|
48
|
+
platforms: arm64
|
|
49
|
+
|
|
50
|
+
- name: Build wheels
|
|
51
|
+
uses: PyO3/maturin-action@v1
|
|
52
|
+
with:
|
|
53
|
+
target: ${{ matrix.target }}
|
|
54
|
+
args: --release --strip --out dist --interpreter 3.12 3.13
|
|
55
|
+
sccache: 'true'
|
|
56
|
+
manylinux: auto
|
|
57
|
+
env:
|
|
58
|
+
CFLAGS_aarch64_unknown_linux_gnu: "-march=armv8-a -D__ARM_ARCH=8"
|
|
59
|
+
CFLAGS_aarch64_unknown_linux_musl: "-march=armv8-a -D__ARM_ARCH=8"
|
|
60
|
+
|
|
61
|
+
- name: Upload wheels
|
|
62
|
+
uses: actions/upload-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: wheels-${{ matrix.target }}
|
|
65
|
+
path: dist
|
|
66
|
+
|
|
67
|
+
# ── Build source distribution ─────────────────────────────────────────
|
|
68
|
+
build-sdist:
|
|
69
|
+
name: Build sdist
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v4
|
|
73
|
+
|
|
74
|
+
- name: Build sdist
|
|
75
|
+
uses: PyO3/maturin-action@v1
|
|
76
|
+
with:
|
|
77
|
+
command: sdist
|
|
78
|
+
args: --out dist
|
|
79
|
+
|
|
80
|
+
- name: Upload sdist
|
|
81
|
+
uses: actions/upload-artifact@v4
|
|
82
|
+
with:
|
|
83
|
+
name: wheels-sdist
|
|
84
|
+
path: dist
|
|
85
|
+
|
|
86
|
+
# ── Publish everything to PyPI ────────────────────────────────────────
|
|
87
|
+
publish:
|
|
88
|
+
name: Publish to PyPI
|
|
89
|
+
runs-on: ubuntu-latest
|
|
90
|
+
needs: [build-wheels, build-sdist]
|
|
91
|
+
environment: pypi
|
|
92
|
+
permissions:
|
|
93
|
+
id-token: write
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/download-artifact@v4
|
|
96
|
+
with:
|
|
97
|
+
pattern: wheels-*
|
|
98
|
+
merge-multiple: true
|
|
99
|
+
path: dist
|
|
100
|
+
|
|
101
|
+
- name: Publish to PyPI
|
|
102
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
ignyx-2.8.0/.gitignore
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Rust build artifacts
|
|
2
|
+
target/
|
|
3
|
+
|
|
4
|
+
# Python cache
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*.pyo
|
|
8
|
+
*.pyd
|
|
9
|
+
*.so
|
|
10
|
+
.Python
|
|
11
|
+
*.egg-info/
|
|
12
|
+
dist/
|
|
13
|
+
build/
|
|
14
|
+
*.egg
|
|
15
|
+
|
|
16
|
+
# Virtual environments
|
|
17
|
+
.env
|
|
18
|
+
.venv
|
|
19
|
+
env/
|
|
20
|
+
venv/
|
|
21
|
+
|
|
22
|
+
# IDE
|
|
23
|
+
.vscode/
|
|
24
|
+
.idea/
|
|
25
|
+
*.swp
|
|
26
|
+
*.swo
|
|
27
|
+
|
|
28
|
+
# macOS
|
|
29
|
+
.DS_Store
|
|
30
|
+
|
|
31
|
+
# Maturin/wheel builds
|
|
32
|
+
*.whl
|
|
33
|
+
wheels/
|
|
34
|
+
|
|
35
|
+
# Benchmarks output
|
|
36
|
+
*.log
|
ignyx-2.8.0/BENCHMARK.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Ignyx Benchmark Report — Honest Numbers
|
|
2
|
+
|
|
3
|
+
> **Machine**: Apple Silicon M2, native ARM64
|
|
4
|
+
> **Python**: 3.12
|
|
5
|
+
> **Rust**: 1.93.1, release profile (LTO=fat, opt-level=3)
|
|
6
|
+
> **Tool**: `wrk -t4 -c100 -d10s`
|
|
7
|
+
> **Methodology**: Every request acquires the GIL and calls the Python handler. No response caching. No shortcuts.
|
|
8
|
+
|
|
9
|
+
## Results
|
|
10
|
+
|
|
11
|
+
| Endpoint | Ignyx (req/s) | FastAPI (req/s) | Speedup |
|
|
12
|
+
|----------|-------------:|----------------:|--------:|
|
|
13
|
+
| `/plaintext` | **51,771** | 5,846 | **8.8x** |
|
|
14
|
+
| `/json` | **37,138** | 4,844 | **7.6x** |
|
|
15
|
+
| `/users/42` (path param) | **43,261** | 5,306 | **8.1x** |
|
|
16
|
+
|
|
17
|
+
## Latency
|
|
18
|
+
|
|
19
|
+
| Endpoint | Ignyx (avg) | FastAPI (avg) |
|
|
20
|
+
|----------|------------:|--------------:|
|
|
21
|
+
| `/plaintext` | 2.46ms | 17.32ms |
|
|
22
|
+
| `/json` | 4.21ms | 21.23ms |
|
|
23
|
+
| `/users/42` | 3.42ms | 18.89ms |
|
|
24
|
+
|
|
25
|
+
## What's happening on each request
|
|
26
|
+
|
|
27
|
+
**Ignyx:**
|
|
28
|
+
1. Tokio event loop receives connection
|
|
29
|
+
2. Hyper parses HTTP
|
|
30
|
+
3. matchit routes the path (radix tree lookup)
|
|
31
|
+
4. Path parameters extracted (e.g., `{id}` → `"42"`)
|
|
32
|
+
5. GIL acquired via `Python::with_gil()`
|
|
33
|
+
6. `HandlerSignature` cache consulted for type annotations
|
|
34
|
+
7. Path string coerced (`"42"` → `int(42)`) in PyO3
|
|
35
|
+
8. Python handler called with kwargs
|
|
36
|
+
9. Return value serialized (dict → `json.dumps()`, str → plaintext)
|
|
37
|
+
10. GIL released
|
|
38
|
+
11. Hyper sends response
|
|
39
|
+
|
|
40
|
+
**FastAPI:**
|
|
41
|
+
1. Uvicorn receives connection (asyncio + httptools/h11)
|
|
42
|
+
2. Starlette routes the path
|
|
43
|
+
3. FastAPI dependency injection, validation, serialization via Pydantic
|
|
44
|
+
4. Handler called
|
|
45
|
+
5. Response serialized and sent
|
|
46
|
+
|
|
47
|
+
## Why Ignyx is faster
|
|
48
|
+
|
|
49
|
+
- **Hyper vs Uvicorn**: Hyper (Rust) is fundamentally faster than Uvicorn (Python + C extension)
|
|
50
|
+
- **matchit vs Starlette router**: Radix tree vs linear route matching
|
|
51
|
+
- **Signature Caching**: Ignyx caches handler arguments via `inspect` on start-up. No reflection during requests.
|
|
52
|
+
- **Minimal overhead**: Ignyx does raw `json.dumps()`. FastAPI runs Pydantic serialization on every response.
|
|
53
|
+
- **No ASGI overhead**: Ignyx bypasses the ASGI protocol entirely — direct Rust HTTP → Python handler → Rust response.
|
|
54
|
+
|
|
55
|
+
## Honest caveats
|
|
56
|
+
|
|
57
|
+
- FastAPI's numbers include Pydantic validation overhead which provides value (type safety, serialization). Ignyx currently relies on PyO3 coercion but delegates deeper validation to the user.
|
|
58
|
+
- All tests on Rosetta 2 (x86_64 emulation on Apple Silicon). Native ARM builds would likely be faster for both.
|
ignyx-2.8.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.1.4] - Performance & Linting
|
|
9
|
+
### Fixed
|
|
10
|
+
- Addressed multiple Ruff linting errors (unused imports, static f-strings, type comparisons)
|
|
11
|
+
- Optimized server headers and version consistency
|
|
12
|
+
|
|
13
|
+
## [2.1.3] - Professional Extras
|
|
14
|
+
### Added
|
|
15
|
+
- OpenAPI: Pydantic model schemas in components/schemas with $ref links
|
|
16
|
+
- OpenAPI: query parameter documentation from type hints
|
|
17
|
+
- OpenAPI: tags support on route decorators
|
|
18
|
+
- Hot reload: app.run(reload=True) with watchfiles support
|
|
19
|
+
- Star history chart in README
|
|
20
|
+
- Coverage badge in README
|
|
21
|
+
|
|
22
|
+
## [2.1.2] - Package Polish
|
|
23
|
+
### Changed
|
|
24
|
+
- Complete type annotations on all public Python APIs
|
|
25
|
+
- Updated pyproject.toml with optional dev and reload dependencies
|
|
26
|
+
- Verified and expanded __all__ in __init__.py
|
|
27
|
+
- All public methods have docstrings
|
|
28
|
+
|
|
29
|
+
## [2.1.1] - Documentation
|
|
30
|
+
### Added
|
|
31
|
+
- Full docs for dependency_injection, middleware, request, response
|
|
32
|
+
- New pages: testing, security, static_files, lifespan, error_handling
|
|
33
|
+
- Expanded docs for routing, websockets, validation, deployment
|
|
34
|
+
### Changed
|
|
35
|
+
- Updated mkdocs.yml navigation to include all pages
|
|
36
|
+
- Added code copy button and search suggestions to MkDocs theme
|
|
37
|
+
|
|
38
|
+
## [2.1.0] - CI/CD Improvements
|
|
39
|
+
### Changed
|
|
40
|
+
- Expanded CI matrix to Ubuntu, macOS, Windows × Python 3.12 + 3.13
|
|
41
|
+
- Added cargo clippy (deny warnings) to CI lint job
|
|
42
|
+
- Added cargo fmt --check to CI lint job
|
|
43
|
+
- Added ruff Python linting to CI lint job
|
|
44
|
+
### Added
|
|
45
|
+
- ruff configuration in pyproject.toml
|
|
46
|
+
|
|
47
|
+
## [1.1.1] - Test Suite Expansion & Core Fixes
|
|
48
|
+
### Changed
|
|
49
|
+
- Rewrote `conftest.py` to use `TestClient` (removed 2-second sleep antipattern)
|
|
50
|
+
- Switched `add_middleware` to append instead of prepend to ensure addition order matches execution order
|
|
51
|
+
### Added
|
|
52
|
+
- `test_middleware.py` — CORS, rate limiting, middleware ordering
|
|
53
|
+
- `test_dependencies.py` — `Depends()`, `BackgroundTask`
|
|
54
|
+
- `test_security.py` — OAuth2, APIKey, HTTPBasic
|
|
55
|
+
- `test_exceptions.py` — `HTTPException`, custom handlers
|
|
56
|
+
- `test_lifespan.py` — startup/shutdown, `app.state`
|
|
57
|
+
- `test_openapi.py` — schema generation, Swagger UI, ReDoc
|
|
58
|
+
- `test_static.py` — static file serving
|
|
59
|
+
- `pytest-cov` for coverage measurement
|
|
60
|
+
### Fixed
|
|
61
|
+
- **Pydantic Validation:** Correctly return 422 Unprocessable Entity for schema validation errors (previously 500)
|
|
62
|
+
- **Response Headers:** Fixed missing headers in `BaseResponse` objects and enabled merging with tuple-provided headers
|
|
63
|
+
- **FileResponse:** Resolved double-quoting/serialization issues with raw bytes in `FileResponse`
|
|
64
|
+
- **BackgroundTask:** Fixed initialization crash when passing initial tasks to the constructor
|
|
65
|
+
- **Dependency Injection:** Fixed `BackgroundTask` and `Request` injection into sub-dependencies
|
|
66
|
+
- **Static files:** Hardened path traversal protection in `StaticFiles`
|
|
67
|
+
|
|
68
|
+
## [1.1.0] - New Features
|
|
69
|
+
### Added
|
|
70
|
+
- `HTTPException` class with Rust-side status code handling
|
|
71
|
+
- Lifespan events: `@app.on_startup`, `@app.on_shutdown`
|
|
72
|
+
- `app.state` (SimpleNamespace) for app-wide data storage
|
|
73
|
+
- `TestClient` for testing without starting a real server
|
|
74
|
+
- `OAuth2PasswordBearer`, `APIKeyHeader`, `HTTPBasic` security utilities
|
|
75
|
+
- `RateLimitMiddleware` (sliding window, configurable requests/window)
|
|
76
|
+
- `AccessLogMiddleware` (method + path + status + latency)
|
|
77
|
+
- `StaticFiles` for serving static assets
|
|
78
|
+
- `app.mount()` for mounting sub-applications
|
|
79
|
+
### Fixed
|
|
80
|
+
- BackgroundTask execution no longer relies on a fixed 150ms sleep
|
|
81
|
+
|
|
82
|
+
## [1.0.6] - Code Refactoring
|
|
83
|
+
### Changed
|
|
84
|
+
- Refactored `server.rs` into maintainable modules (`handler.rs`, `websocket.rs`, `middleware.rs`, `multipart.rs`).
|
|
85
|
+
- Optimized `ServerState` by grouping PyObject options into `PythonCachedRefs`.
|
|
86
|
+
- Moved 404 fallback handling from a Python catch-all route into the Rust core.
|
|
87
|
+
- Cached `resolve_dependencies` directly in `HandlerSignature`.
|
|
88
|
+
|
|
89
|
+
## [1.0.5] - README Rewrite
|
|
90
|
+
### Changed
|
|
91
|
+
- Complete README rewrite with full benchmark table
|
|
92
|
+
- Added pepy.tech download badge
|
|
93
|
+
- Added feature comparison table vs FastAPI
|
|
94
|
+
- Added current limitations section
|
|
95
|
+
- Added collapsible feature examples
|
|
96
|
+
|
|
97
|
+
## [1.0.4] - Repository Structure
|
|
98
|
+
### Added
|
|
99
|
+
- CONTRIBUTING.md with dev setup guide
|
|
100
|
+
- CODE_OF_CONDUCT.md (Contributor Covenant v2.1)
|
|
101
|
+
- SECURITY.md with vulnerability reporting process
|
|
102
|
+
- GitHub issue templates (bug report, feature request)
|
|
103
|
+
- GitHub PR template
|
|
104
|
+
- docs.yml workflow for auto-deploying MkDocs to GitHub Pages
|
|
105
|
+
- static/swagger-ui.html for self-hosted API docs
|
|
106
|
+
- 6 new example files in examples/
|
|
107
|
+
- benchmarks/results/ directory
|
|
108
|
+
|
|
109
|
+
### Removed
|
|
110
|
+
- benchmarks/test_loop.py, test_thread_local.py, test_threadsafe.py
|
|
111
|
+
(test utilities moved to dev notes, not part of benchmark suite)
|
|
112
|
+
|
|
113
|
+
## [1.0.3] - Unreleased
|
|
114
|
+
|
|
115
|
+
### Added
|
|
116
|
+
- **PEP 561 Compliance:** Added `py.typed` marker to enable strict type-checking in external projects.
|
|
117
|
+
- **Type Hints:** Added comprehensive type annotations to core Python components (`app.py`, `router.py`, `responses.py`) to drastically improve developer experience in modern IDEs like VS Code and PyCharm.
|
|
118
|
+
- **Documentation:** Added professional, PEP-257 compliant docstrings to all major classes and methods (e.g., `Router`, `JSONResponse`, `FileResponse`).
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
- Refactored `__version__` export in python module to accurately reflect Rust crate versions.
|
|
122
|
+
- Updated default `server` headers globally from `Ignyx/0.1.0` to `Ignyx/1.0.0` making HTTP response metadata accurate.
|
|
123
|
+
- Promoted PyPI classifier from `Development Status :: 3 - Alpha` to `Development Status :: 5 - Production/Stable`.
|
|
124
|
+
- Added `Framework :: AsyncIO` PyPI classifier for exact framework precision.
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
- Fixed internal typing inconsistencies and missing arguments traversing the Rust-Python barrier.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
5
|
+
|
|
6
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
7
|
+
|
|
8
|
+
## Our Standards
|
|
9
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
10
|
+
|
|
11
|
+
* Demonstrating empathy and kindness toward other people
|
|
12
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
13
|
+
* Giving and gracefully accepting constructive feedback
|
|
14
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
15
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behavior include:
|
|
18
|
+
|
|
19
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
20
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
21
|
+
* Public or private harassment
|
|
22
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
23
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
+
|
|
25
|
+
## Enforcement Responsibilities
|
|
26
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
27
|
+
|
|
28
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
29
|
+
|
|
30
|
+
## Scope
|
|
31
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
32
|
+
|
|
33
|
+
## Enforcement
|
|
34
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
|
|
35
|
+
|
|
36
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
37
|
+
|
|
38
|
+
## Enforcement Guidelines
|
|
39
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
40
|
+
|
|
41
|
+
### 1. Correction
|
|
42
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
43
|
+
|
|
44
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
45
|
+
|
|
46
|
+
### 2. Warning
|
|
47
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
48
|
+
|
|
49
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
50
|
+
|
|
51
|
+
### 3. Temporary Ban
|
|
52
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
53
|
+
|
|
54
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
55
|
+
|
|
56
|
+
### 4. Permanent Ban
|
|
57
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
58
|
+
|
|
59
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
60
|
+
|
|
61
|
+
## Attribution
|
|
62
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
63
|
+
|
|
64
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
65
|
+
|
|
66
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
67
|
+
|
|
68
|
+
[homepage]: https://www.contributor-covenant.org
|
|
69
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
70
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
71
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
72
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Contributing to Ignyx
|
|
2
|
+
|
|
3
|
+
## Development Environment Setup
|
|
4
|
+
```bash
|
|
5
|
+
git clone https://github.com/sakethdevx/ignyx.git
|
|
6
|
+
cd ignyx
|
|
7
|
+
python -m venv .venv
|
|
8
|
+
source .venv/bin/activate
|
|
9
|
+
pip install maturin pytest pydantic httpx websockets
|
|
10
|
+
maturin develop --release
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Running Tests
|
|
14
|
+
```bash
|
|
15
|
+
pytest tests/ -v
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Running Rust Tests
|
|
19
|
+
```bash
|
|
20
|
+
cargo test
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Code Style
|
|
24
|
+
- `cargo fmt` for Rust
|
|
25
|
+
- `ruff check python/` for Python
|
|
26
|
+
|
|
27
|
+
## PR Guidelines
|
|
28
|
+
- One feature per PR
|
|
29
|
+
- Tests required
|
|
30
|
+
- Docs required
|