alphaapi 0.2.0b0__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.
Files changed (116) hide show
  1. alphaapi-0.2.0b0/.github/workflows/ci.yml +69 -0
  2. alphaapi-0.2.0b0/.github/workflows/docs.yml +43 -0
  3. alphaapi-0.2.0b0/.github/workflows/release.yml +24 -0
  4. alphaapi-0.2.0b0/.gitignore +14 -0
  5. alphaapi-0.2.0b0/Cargo.lock +598 -0
  6. alphaapi-0.2.0b0/Cargo.toml +35 -0
  7. alphaapi-0.2.0b0/LICENSE +21 -0
  8. alphaapi-0.2.0b0/PKG-INFO +663 -0
  9. alphaapi-0.2.0b0/README.md +629 -0
  10. alphaapi-0.2.0b0/benchmarks/bench.py +233 -0
  11. alphaapi-0.2.0b0/benchmarks/loadgen.rs +124 -0
  12. alphaapi-0.2.0b0/benchmarks/server_alpha.py +36 -0
  13. alphaapi-0.2.0b0/benchmarks/server_fastapi.py +34 -0
  14. alphaapi-0.2.0b0/docs/api/application.md +48 -0
  15. alphaapi-0.2.0b0/docs/api/apps.md +41 -0
  16. alphaapi-0.2.0b0/docs/api/binding.md +173 -0
  17. alphaapi-0.2.0b0/docs/api/cli.md +88 -0
  18. alphaapi-0.2.0b0/docs/api/core.md +49 -0
  19. alphaapi-0.2.0b0/docs/api/exceptions.md +42 -0
  20. alphaapi-0.2.0b0/docs/api/index.md +99 -0
  21. alphaapi-0.2.0b0/docs/api/middleware.md +47 -0
  22. alphaapi-0.2.0b0/docs/api/observability.md +109 -0
  23. alphaapi-0.2.0b0/docs/api/openapi.md +69 -0
  24. alphaapi-0.2.0b0/docs/api/requests.md +108 -0
  25. alphaapi-0.2.0b0/docs/api/responses.md +104 -0
  26. alphaapi-0.2.0b0/docs/api/routing.md +90 -0
  27. alphaapi-0.2.0b0/docs/api/security.md +166 -0
  28. alphaapi-0.2.0b0/docs/api/sessions.md +140 -0
  29. alphaapi-0.2.0b0/docs/api/settings.md +157 -0
  30. alphaapi-0.2.0b0/docs/api/static-files.md +61 -0
  31. alphaapi-0.2.0b0/docs/api/streaming.md +99 -0
  32. alphaapi-0.2.0b0/docs/api/templates.md +66 -0
  33. alphaapi-0.2.0b0/docs/api/testing.md +76 -0
  34. alphaapi-0.2.0b0/docs/api/views.md +54 -0
  35. alphaapi-0.2.0b0/docs/getting-started.md +276 -0
  36. alphaapi-0.2.0b0/docs/index.md +127 -0
  37. alphaapi-0.2.0b0/docs/stylesheets/extra.css +22 -0
  38. alphaapi-0.2.0b0/docs/tutorials/blog.md +322 -0
  39. alphaapi-0.2.0b0/docs/tutorials/deployment.md +337 -0
  40. alphaapi-0.2.0b0/docs/tutorials/index.md +44 -0
  41. alphaapi-0.2.0b0/docs/tutorials/task-api.md +367 -0
  42. alphaapi-0.2.0b0/examples/__init__.py +1 -0
  43. alphaapi-0.2.0b0/examples/basic.py +108 -0
  44. alphaapi-0.2.0b0/examples/manage.py +15 -0
  45. alphaapi-0.2.0b0/examples/project/__init__.py +1 -0
  46. alphaapi-0.2.0b0/examples/project/app.py +6 -0
  47. alphaapi-0.2.0b0/examples/project/middleware.py +16 -0
  48. alphaapi-0.2.0b0/examples/project/settings.py +12 -0
  49. alphaapi-0.2.0b0/examples/project/urls.py +17 -0
  50. alphaapi-0.2.0b0/examples/project/views.py +33 -0
  51. alphaapi-0.2.0b0/examples/test/manage.py +10 -0
  52. alphaapi-0.2.0b0/examples/test/test/__init__.py +0 -0
  53. alphaapi-0.2.0b0/examples/test/test/app.py +6 -0
  54. alphaapi-0.2.0b0/examples/test/test/settings.py +10 -0
  55. alphaapi-0.2.0b0/examples/test/test/urls.py +11 -0
  56. alphaapi-0.2.0b0/examples/test/test/views.py +13 -0
  57. alphaapi-0.2.0b0/mkdocs.yml +117 -0
  58. alphaapi-0.2.0b0/pyproject.toml +69 -0
  59. alphaapi-0.2.0b0/python/alphaapi/__init__.py +178 -0
  60. alphaapi-0.2.0b0/python/alphaapi/_core.pyi +67 -0
  61. alphaapi-0.2.0b0/python/alphaapi/_debug.py +46 -0
  62. alphaapi-0.2.0b0/python/alphaapi/_helpers.py +63 -0
  63. alphaapi-0.2.0b0/python/alphaapi/app.py +640 -0
  64. alphaapi-0.2.0b0/python/alphaapi/apps.py +126 -0
  65. alphaapi-0.2.0b0/python/alphaapi/auth.py +101 -0
  66. alphaapi-0.2.0b0/python/alphaapi/cli.py +261 -0
  67. alphaapi-0.2.0b0/python/alphaapi/conf.py +225 -0
  68. alphaapi-0.2.0b0/python/alphaapi/cors.py +62 -0
  69. alphaapi-0.2.0b0/python/alphaapi/csrf.py +65 -0
  70. alphaapi-0.2.0b0/python/alphaapi/exceptions.py +74 -0
  71. alphaapi-0.2.0b0/python/alphaapi/http/__init__.py +48 -0
  72. alphaapi-0.2.0b0/python/alphaapi/http/multipart.py +127 -0
  73. alphaapi-0.2.0b0/python/alphaapi/http/request.py +261 -0
  74. alphaapi-0.2.0b0/python/alphaapi/http/response.py +574 -0
  75. alphaapi-0.2.0b0/python/alphaapi/middleware.py +49 -0
  76. alphaapi-0.2.0b0/python/alphaapi/observability.py +152 -0
  77. alphaapi-0.2.0b0/python/alphaapi/openapi.py +205 -0
  78. alphaapi-0.2.0b0/python/alphaapi/params.py +338 -0
  79. alphaapi-0.2.0b0/python/alphaapi/py.typed +0 -0
  80. alphaapi-0.2.0b0/python/alphaapi/scaffold.py +180 -0
  81. alphaapi-0.2.0b0/python/alphaapi/security.py +75 -0
  82. alphaapi-0.2.0b0/python/alphaapi/sessions.py +186 -0
  83. alphaapi-0.2.0b0/python/alphaapi/signed_cookies.py +72 -0
  84. alphaapi-0.2.0b0/python/alphaapi/staticfiles.py +51 -0
  85. alphaapi-0.2.0b0/python/alphaapi/templates.py +91 -0
  86. alphaapi-0.2.0b0/python/alphaapi/testing.py +200 -0
  87. alphaapi-0.2.0b0/python/alphaapi/urls.py +414 -0
  88. alphaapi-0.2.0b0/python/alphaapi/views.py +114 -0
  89. alphaapi-0.2.0b0/python/alphaapi/welcome.py +115 -0
  90. alphaapi-0.2.0b0/review.txt +77 -0
  91. alphaapi-0.2.0b0/src/app.rs +2075 -0
  92. alphaapi-0.2.0b0/src/lib.rs +28 -0
  93. alphaapi-0.2.0b0/src/request.rs +161 -0
  94. alphaapi-0.2.0b0/src/response.rs +149 -0
  95. alphaapi-0.2.0b0/src/spec.rs +166 -0
  96. alphaapi-0.2.0b0/src/util.rs +242 -0
  97. alphaapi-0.2.0b0/tasks/manage.py +10 -0
  98. alphaapi-0.2.0b0/tasks/tasks/__init__.py +0 -0
  99. alphaapi-0.2.0b0/tasks/tasks/app.py +6 -0
  100. alphaapi-0.2.0b0/tasks/tasks/settings.py +10 -0
  101. alphaapi-0.2.0b0/tasks/tasks/store.py +51 -0
  102. alphaapi-0.2.0b0/tasks/tasks/urls.py +10 -0
  103. alphaapi-0.2.0b0/tasks/tasks/views.py +86 -0
  104. alphaapi-0.2.0b0/tests/conftest.py +97 -0
  105. alphaapi-0.2.0b0/tests/test_alpha.py +521 -0
  106. alphaapi-0.2.0b0/tests/test_binding.py +229 -0
  107. alphaapi-0.2.0b0/tests/test_cli.py +145 -0
  108. alphaapi-0.2.0b0/tests/test_cli_tools.py +76 -0
  109. alphaapi-0.2.0b0/tests/test_multipart.py +160 -0
  110. alphaapi-0.2.0b0/tests/test_observability.py +120 -0
  111. alphaapi-0.2.0b0/tests/test_openapi_static_templates.py +180 -0
  112. alphaapi-0.2.0b0/tests/test_review_regressions.py +196 -0
  113. alphaapi-0.2.0b0/tests/test_security_features.py +307 -0
  114. alphaapi-0.2.0b0/tests/test_sessions_auth.py +163 -0
  115. alphaapi-0.2.0b0/tests/test_streaming_files.py +228 -0
  116. alphaapi-0.2.0b0/tests/test_test_client.py +132 -0
@@ -0,0 +1,69 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ rust:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: dtolnay/rust-toolchain@stable
18
+ with:
19
+ components: rustfmt, clippy
20
+ - uses: Swatinem/rust-cache@v2
21
+ - name: Format
22
+ run: cargo fmt --all --check
23
+ - name: Clippy
24
+ run: cargo clippy --all-targets -- -D warnings
25
+ - name: Rust unit tests
26
+ run: cargo test --all-targets
27
+
28
+ python:
29
+ runs-on: ${{ matrix.os }}
30
+ strategy:
31
+ fail-fast: false
32
+ matrix:
33
+ os: [ubuntu-latest, windows-latest]
34
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: ${{ matrix.python-version }}
40
+ - uses: dtolnay/rust-toolchain@stable
41
+ - uses: Swatinem/rust-cache@v2
42
+ - name: Install package
43
+ run: pip install -e ".[dev]"
44
+ - name: Test
45
+ run: pytest -q
46
+
47
+ lint:
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+ - uses: actions/setup-python@v5
52
+ with:
53
+ python-version: "3.12"
54
+ - name: Install Ruff
55
+ run: pip install "ruff>=0.6"
56
+ - name: Ruff
57
+ run: ruff check python tests
58
+
59
+ mypy:
60
+ runs-on: ubuntu-latest
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - uses: actions/setup-python@v5
64
+ with:
65
+ python-version: "3.12"
66
+ - name: Install mypy
67
+ run: pip install mypy
68
+ - name: Mypy
69
+ run: mypy python
@@ -0,0 +1,43 @@
1
+ name: docs
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+ pages: write
10
+ id-token: write
11
+
12
+ concurrency:
13
+ group: pages
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.12"
24
+ - uses: dtolnay/rust-toolchain@stable
25
+ - name: Install the package and documentation tooling
26
+ # The API reference imports alphaapi, which needs the compiled Rust
27
+ # extension. Building the editable package supplies both.
28
+ run: pip install -e ".[docs]"
29
+ - name: Build site
30
+ run: mkdocs build --strict
31
+ - uses: actions/upload-pages-artifact@v3
32
+ with:
33
+ path: site
34
+
35
+ deploy:
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ environment:
39
+ name: github-pages
40
+ url: ${{ steps.deployment.outputs.page_url }}
41
+ steps:
42
+ - id: deployment
43
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,24 @@
1
+ name: release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+ id-token: write
10
+
11
+ jobs:
12
+ pypi:
13
+ name: Publish to PyPI
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+ - uses: dtolnay/rust-toolchain@stable
21
+ - name: Build sdist and wheels
22
+ run: pip install -q "maturin>=1.7,<2.0" && maturin sdist --out dist && maturin build --release --out dist
23
+ - name: Publish to PyPI
24
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,14 @@
1
+ /target
2
+ /.venv
3
+ /dist
4
+ /build
5
+ /site
6
+ /.idea
7
+ *.egg-info
8
+ __pycache__/
9
+ *.py[cod]
10
+ .pytest_cache/
11
+ .maturin
12
+ *.so
13
+ *.pyd
14
+ *.dylib