aiohttp-apigami 0.5.0rc2__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 (64) hide show
  1. aiohttp_apigami-0.5.0rc2/.github/dependabot.yml +14 -0
  2. aiohttp_apigami-0.5.0rc2/.github/pr-labeler.yml +3 -0
  3. aiohttp_apigami-0.5.0rc2/.github/workflows/check-swagger-ui.yml +85 -0
  4. aiohttp_apigami-0.5.0rc2/.github/workflows/ci.yml +92 -0
  5. aiohttp_apigami-0.5.0rc2/.github/workflows/pr-labeler.yml +19 -0
  6. aiohttp_apigami-0.5.0rc2/.github/workflows/publish.yml +25 -0
  7. aiohttp_apigami-0.5.0rc2/.gitignore +23 -0
  8. aiohttp_apigami-0.5.0rc2/.pre-commit-config.yaml +25 -0
  9. aiohttp_apigami-0.5.0rc2/LICENSE +13 -0
  10. aiohttp_apigami-0.5.0rc2/MANIFEST.in +17 -0
  11. aiohttp_apigami-0.5.0rc2/Makefile +50 -0
  12. aiohttp_apigami-0.5.0rc2/PKG-INFO +430 -0
  13. aiohttp_apigami-0.5.0rc2/README.md +402 -0
  14. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/__init__.py +40 -0
  15. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/constants.py +17 -0
  16. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/core.py +261 -0
  17. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/decorators/__init__.py +12 -0
  18. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/decorators/docs.py +108 -0
  19. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/decorators/request.py +166 -0
  20. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/decorators/response.py +89 -0
  21. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/middlewares.py +83 -0
  22. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/processors.py +207 -0
  23. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/py.typed +1 -0
  24. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/route_processor.py +76 -0
  25. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/spec.py +82 -0
  26. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/VERSION +1 -0
  27. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/favicon-16x16.png +0 -0
  28. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/favicon-32x32.png +0 -0
  29. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/index.css +16 -0
  30. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/index.html +37 -0
  31. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/oauth2-redirect.html +79 -0
  32. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-initializer.js +20 -0
  33. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-bundle.js +2 -0
  34. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-bundle.js.map +1 -0
  35. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-es-bundle-core.js +3 -0
  36. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-es-bundle-core.js.map +1 -0
  37. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-es-bundle.js +2 -0
  38. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-es-bundle.js.map +1 -0
  39. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-standalone-preset.js +2 -0
  40. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui-standalone-preset.js.map +1 -0
  41. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui.css +3 -0
  42. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui.css.map +1 -0
  43. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui.js +2 -0
  44. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui/swagger-ui.js.map +1 -0
  45. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/swagger_ui.py +65 -0
  46. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/typedefs.py +16 -0
  47. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/utils.py +78 -0
  48. aiohttp_apigami-0.5.0rc2/aiohttp_apigami/validation.py +10 -0
  49. aiohttp_apigami-0.5.0rc2/example/run.py +7 -0
  50. aiohttp_apigami-0.5.0rc2/example/src/__init__.py +0 -0
  51. aiohttp_apigami-0.5.0rc2/example/src/app.py +33 -0
  52. aiohttp_apigami-0.5.0rc2/example/src/routes.py +12 -0
  53. aiohttp_apigami-0.5.0rc2/example/src/schemas.py +20 -0
  54. aiohttp_apigami-0.5.0rc2/example/src/views.py +67 -0
  55. aiohttp_apigami-0.5.0rc2/pyproject.toml +85 -0
  56. aiohttp_apigami-0.5.0rc2/tests/__init__.py +0 -0
  57. aiohttp_apigami-0.5.0rc2/tests/conftest.py +286 -0
  58. aiohttp_apigami-0.5.0rc2/tests/decorators/__init__.py +0 -0
  59. aiohttp_apigami-0.5.0rc2/tests/decorators/test_by_dataclass.py +188 -0
  60. aiohttp_apigami-0.5.0rc2/tests/decorators/test_by_schema.py +226 -0
  61. aiohttp_apigami-0.5.0rc2/tests/test_documentation.py +185 -0
  62. aiohttp_apigami-0.5.0rc2/tests/test_utils.py +166 -0
  63. aiohttp_apigami-0.5.0rc2/tests/test_web_app.py +277 -0
  64. aiohttp_apigami-0.5.0rc2/tools/update_swagger_ui.py +385 -0
@@ -0,0 +1,14 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ open-pull-requests-limit: 10
9
+
10
+ - package-ecosystem: "uv"
11
+ directory: "/"
12
+ schedule:
13
+ interval: daily
14
+ open-pull-requests-limit: 10
@@ -0,0 +1,3 @@
1
+ feature: ['feature/*', 'feat/*']
2
+ fix: ['fix/*', 'bug/*', 'bugfix/*']
3
+ chore: ['chore/*', 'tech/*', 'refactor/*']
@@ -0,0 +1,85 @@
1
+ name: Check Swagger UI Version
2
+
3
+ on:
4
+ schedule:
5
+ # Run weekly on Monday at 8:00 UTC
6
+ - cron: '0 8 * * 1'
7
+ workflow_dispatch: # Allow manual triggering
8
+
9
+
10
+ jobs:
11
+ check-swagger-ui-version:
12
+ permissions:
13
+ contents: write
14
+ pull-requests: write
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Install the latest version of uv
21
+ uses: astral-sh/setup-uv@v5
22
+ with:
23
+ enable-cache: true
24
+ cache-dependency-glob: "pyproject.toml"
25
+ python-version: ${{ matrix.python-version }}
26
+ - name: Install dependencies
27
+ run: uv sync
28
+
29
+ - name: Get current version of Swagger UI
30
+ id: current_version
31
+ run: |
32
+ VERSION=$(cat aiohttp_apigami/swagger_ui/VERSION)
33
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
34
+
35
+ - name: Run update Swagger UI to latest version
36
+ run: |
37
+ uv run tools/update_swagger_ui.py
38
+
39
+
40
+ - name: Get updated version of Swagger UI
41
+ id: updated_version
42
+ run: |
43
+ VERSION=$(cat aiohttp_apigami/swagger_ui/VERSION)
44
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
45
+
46
+ - name: Run pre-commit
47
+ if: steps.current_version.outputs.version != steps.updated_version.outputs.version
48
+ run: |
49
+ uv run pre-commit run --all-files
50
+ continue-on-error: true
51
+
52
+ - name: Create Pull Request
53
+ if: steps.current_version.outputs.version != steps.updated_version.outputs.version
54
+ uses: peter-evans/create-pull-request@v7
55
+ with:
56
+ token: ${{ secrets.GITHUB_TOKEN }}
57
+ commit-message: "Update Swagger UI to ${{ steps.updated_version.outputs.version }}"
58
+ committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
59
+ author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
60
+ signoff: false
61
+ branch: "tech/update-swagger-ui-to-${{ steps.updated_version.outputs.version }}"
62
+ delete-branch: true
63
+ base: "master"
64
+ title: "Update Swagger UI to ${{ steps.updated_version.outputs.version }}"
65
+ body: |
66
+ ## Automated Swagger UI Update
67
+
68
+ This PR updates Swagger UI from `${{ steps.current_version.outputs.version }}`[1] to `${{ steps.updated_version.outputs.version }}`[2].
69
+
70
+ Changes are automatically generated by the GitHub workflow 'check-swagger-ui.yml'.
71
+
72
+ ### Changes included:
73
+ - Updated Swagger UI distribution files
74
+ - Updated version references in documentation
75
+
76
+ ### Checklist:
77
+ - [ ] Review the changes to ensure everything works as expected
78
+ - [ ] Run tests to verify compatibility
79
+
80
+ [1]: https://github.com/swagger-api/swagger-ui/releases/tag/v${{ steps.current_version.outputs.version }}
81
+ [2]: https://github.com/swagger-api/swagger-ui/releases/tag/v${{ steps.updated_version.outputs.version }}
82
+ labels: |
83
+ enhancement
84
+ dependencies
85
+ draft: false
@@ -0,0 +1,92 @@
1
+ name: Build
2
+
3
+ on:
4
+ push:
5
+ branches: [ 'master' ]
6
+ pull_request:
7
+
8
+ # one running workflow per branch, others will wait
9
+ concurrency: ${{ github.ref }}
10
+
11
+ env:
12
+ MIN_PYTHON_VERSION: "3.10"
13
+
14
+ jobs:
15
+ pre-commit:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: ${{ env.MIN_PYTHON_VERSION }}
22
+ - uses: pre-commit/action@v3.0.1
23
+
24
+ mypy:
25
+ runs-on: ubuntu-latest
26
+ strategy:
27
+ matrix:
28
+ python-version: [ '3.10', '3.11', '3.12', '3.13' ]
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - name: Install the latest version of uv
32
+ uses: astral-sh/setup-uv@v5
33
+ with:
34
+ enable-cache: true
35
+ cache-dependency-glob: "pyproject.toml"
36
+ python-version: ${{ matrix.python-version }}
37
+ - name: Install dependencies
38
+ run: uv sync
39
+ - name: Run mypy
40
+ run: uv run mypy .
41
+
42
+ test:
43
+ runs-on: ubuntu-latest
44
+ needs:
45
+ - pre-commit
46
+ - mypy
47
+ strategy:
48
+ matrix:
49
+ python-version: [ '3.10', '3.11', '3.12', '3.13' ]
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+ - name: Install the latest version of uv
53
+ uses: astral-sh/setup-uv@v5
54
+ with:
55
+ enable-cache: true
56
+ cache-dependency-glob: "pyproject.toml"
57
+ python-version: ${{ matrix.python-version }}
58
+ - name: Install dependencies
59
+ run: uv sync
60
+ - name: Run test
61
+ run: uv run pytest
62
+
63
+ - name: Upload coverage reports to Codecov
64
+ uses: codecov/codecov-action@v5
65
+ env:
66
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
67
+ slug: kulapard/aiohttp-apigami
68
+
69
+ - name: Upload test results to Codecov
70
+ if: ${{ !cancelled() }}
71
+ uses: codecov/test-results-action@v1
72
+ with:
73
+ token: ${{ secrets.CODECOV_TOKEN }}
74
+
75
+
76
+ # https://github.com/marketplace/actions/alls-green#why
77
+ check: # This job does nothing and is only used for the branch protection
78
+ if: always()
79
+ needs:
80
+ - pre-commit
81
+ - mypy
82
+ - test
83
+ runs-on: ubuntu-latest
84
+ steps:
85
+ - name: Dump GitHub context
86
+ env:
87
+ GITHUB_CONTEXT: ${{ toJson(github) }}
88
+ run: echo "$GITHUB_CONTEXT"
89
+ - name: Decide whether the needed jobs succeeded or failed
90
+ uses: re-actors/alls-green@release/v1
91
+ with:
92
+ jobs: ${{ toJSON(needs) }}
@@ -0,0 +1,19 @@
1
+ name: PR Labeler
2
+ on:
3
+ pull_request:
4
+ types: [ opened ]
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ pr-labeler:
11
+ permissions:
12
+ contents: read # for TimonVS/pr-labeler-action to read config file
13
+ pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: TimonVS/pr-labeler-action@v5
17
+ with:
18
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
19
+ configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
@@ -0,0 +1,25 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - created
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ id-token: write
13
+ contents: read
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Install the latest version of uv
17
+ uses: astral-sh/setup-uv@v5
18
+ with:
19
+ enable-cache: false
20
+ python-version: "3.13"
21
+ - name: Build
22
+ run: |
23
+ uv build --verbose
24
+ - name: Publish
25
+ uses: pypa/gh-action-pypi-publish@v1.12.4
@@ -0,0 +1,23 @@
1
+ .idea/
2
+ .vscode/
3
+ *.pyc
4
+ *.cache
5
+ /lib
6
+ /__pycache__
7
+ .coverage
8
+ .pypirc
9
+ .pytest_cache
10
+ /docs/build
11
+ /build
12
+ *.egg-info
13
+ /dist
14
+ .venv
15
+ .mypy_cache/
16
+ .ruff_cache/
17
+ .DS_Store
18
+ .python-version
19
+ .env
20
+ uv.lock
21
+ ai/
22
+ coverage.xml
23
+ junit.xml
@@ -0,0 +1,25 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: check-added-large-files
6
+ args:
7
+ - --maxkb=5000
8
+ - id: check-toml
9
+ - id: check-yaml
10
+ args:
11
+ - --unsafe
12
+ - id: end-of-file-fixer
13
+ - id: trailing-whitespace
14
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
15
+ rev: v0.9.10
16
+ hooks:
17
+ - id: ruff-format
18
+ - id: ruff
19
+ args:
20
+ - --fix
21
+ - --exit-non-zero-on-fix
22
+
23
+ ci:
24
+ autofix_commit_msg: "[pre-commit.ci] Auto format from pre-commit.com hooks"
25
+ autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
@@ -0,0 +1,13 @@
1
+ Copyright Taras Drapalyuk
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,17 @@
1
+ include LICENSE
2
+ include README.md
3
+ include Makefile
4
+ include pyproject.toml
5
+ graft aiohttp_apigami
6
+ graft tests
7
+ graft examples
8
+ graft tools
9
+ global-exclude *.pyc
10
+ global-exclude *.pyd
11
+ global-exclude *.so
12
+ global-exclude *.lib
13
+ global-exclude *.dll
14
+ global-exclude *.a
15
+ global-exclude *.obj
16
+ global-exclude __pycache__
17
+ prune docs/_build
@@ -0,0 +1,50 @@
1
+ include .env
2
+
3
+ all: lint test
4
+
5
+ # Install dependencies
6
+ deps:
7
+ uv sync --frozen --all-extras --dev
8
+
9
+ test:
10
+ uv run pytest
11
+
12
+ build:
13
+ uv build --verbose
14
+
15
+ publish:
16
+ uv publish --verbose --token ${PYPI_API_TOKEN}
17
+
18
+ mypy:
19
+ uv run mypy .
20
+
21
+ pre-commit:
22
+ uv run pre-commit run --all-files
23
+
24
+ pre-commit-update:
25
+ uv run pre-commit autoupdate
26
+
27
+ lint: pre-commit mypy
28
+
29
+ clean:
30
+ rm -rf `find . -name __pycache__`
31
+ rm -f `find . -type f -name '*.py[co]' `
32
+ rm -f `find . -type f -name '*~' `
33
+ rm -f `find . -type f -name '.*~' `
34
+ rm -rf `find . -name ".cache"`
35
+ rm -rf `find . -name ".pytest_cache"`
36
+ rm -rf `find . -name ".mypy_cache"`
37
+ rm -rf `find . -name ".ruff_cache"`
38
+ rm -rf htmlcov
39
+ rm -rf *.egg-info
40
+ rm -f .coverage
41
+ rm -f .coverage.*
42
+ rm -rf build
43
+ rm -rf dist
44
+
45
+ run-example:
46
+ uv run python example/run.py
47
+
48
+ update-swagger-ui:
49
+ uv run tools/update_swagger_ui.py
50
+ make pre-commit