fastapi-commons 0.2.5__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.
- fastapi_commons-0.2.5/.coveragerc +28 -0
- fastapi_commons-0.2.5/.github/workflows/checks.yml +63 -0
- fastapi_commons-0.2.5/.github/workflows/python-publish.yaml +47 -0
- fastapi_commons-0.2.5/.github/workflows/release-on-tag-push.yml +52 -0
- fastapi_commons-0.2.5/.gitignore +52 -0
- fastapi_commons-0.2.5/.pre-commit-config.yaml +35 -0
- fastapi_commons-0.2.5/.python-version +1 -0
- fastapi_commons-0.2.5/AUTHORS.rst +5 -0
- fastapi_commons-0.2.5/CHANGELOG.rst +14 -0
- fastapi_commons-0.2.5/LICENSE +604 -0
- fastapi_commons-0.2.5/PKG-INFO +36 -0
- fastapi_commons-0.2.5/README.md +2 -0
- fastapi_commons-0.2.5/README.rst +4 -0
- fastapi_commons-0.2.5/pyproject.toml +160 -0
- fastapi_commons-0.2.5/setup.cfg +4 -0
- fastapi_commons-0.2.5/src/fastapi_commons/__init__.py +28 -0
- fastapi_commons-0.2.5/src/fastapi_commons/auth.py +53 -0
- fastapi_commons-0.2.5/src/fastapi_commons/conf.py +7 -0
- fastapi_commons-0.2.5/src/fastapi_commons/db/__init__.py +0 -0
- fastapi_commons-0.2.5/src/fastapi_commons/db/helpers.py +60 -0
- fastapi_commons-0.2.5/src/fastapi_commons/db/models/__init__.py +7 -0
- fastapi_commons-0.2.5/src/fastapi_commons/db/models/auth.py +28 -0
- fastapi_commons-0.2.5/src/fastapi_commons/db/models/rbac.py +90 -0
- fastapi_commons-0.2.5/src/fastapi_commons/handlers.py +66 -0
- fastapi_commons-0.2.5/src/fastapi_commons/instrumentation.py +35 -0
- fastapi_commons-0.2.5/src/fastapi_commons/middleware.py +101 -0
- fastapi_commons-0.2.5/src/fastapi_commons/permissions.py +46 -0
- fastapi_commons-0.2.5/src/fastapi_commons.egg-info/PKG-INFO +36 -0
- fastapi_commons-0.2.5/src/fastapi_commons.egg-info/SOURCES.txt +33 -0
- fastapi_commons-0.2.5/src/fastapi_commons.egg-info/dependency_links.txt +1 -0
- fastapi_commons-0.2.5/src/fastapi_commons.egg-info/requires.txt +16 -0
- fastapi_commons-0.2.5/src/fastapi_commons.egg-info/top_level.txt +1 -0
- fastapi_commons-0.2.5/tests/__init__.py +0 -0
- fastapi_commons-0.2.5/tests/conftest.py +10 -0
- fastapi_commons-0.2.5/uv.lock +2359 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# .coveragerc to control coverage.py
|
|
2
|
+
[run]
|
|
3
|
+
branch = True
|
|
4
|
+
source = fastapi_commons
|
|
5
|
+
# omit = bad_file.py
|
|
6
|
+
|
|
7
|
+
[paths]
|
|
8
|
+
source =
|
|
9
|
+
src/
|
|
10
|
+
*/site-packages/
|
|
11
|
+
|
|
12
|
+
[report]
|
|
13
|
+
# Regexes for lines to exclude from consideration
|
|
14
|
+
exclude_lines =
|
|
15
|
+
# Have to re-enable the standard pragma
|
|
16
|
+
pragma: no cover
|
|
17
|
+
|
|
18
|
+
# Don't complain about missing debug-only code:
|
|
19
|
+
def __repr__
|
|
20
|
+
if self\.debug
|
|
21
|
+
|
|
22
|
+
# Don't complain if tests don't hit defensive assertion code:
|
|
23
|
+
raise AssertionError
|
|
24
|
+
raise NotImplementedError
|
|
25
|
+
|
|
26
|
+
# Don't complain if non-runnable code isn't run:
|
|
27
|
+
if 0:
|
|
28
|
+
if __name__ == .__main__.:
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
|
|
6
|
+
concurrency:
|
|
7
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
8
|
+
cancel-in-progress: true
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
lint:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Check Out Repo
|
|
15
|
+
uses: actions/checkout@v5
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v6
|
|
19
|
+
with:
|
|
20
|
+
enable-cache: true
|
|
21
|
+
cache-dependency-glob: "uv.lock"
|
|
22
|
+
|
|
23
|
+
- name: "Set up Python"
|
|
24
|
+
uses: actions/setup-python@v6
|
|
25
|
+
with:
|
|
26
|
+
python-version-file: "pyproject.toml"
|
|
27
|
+
|
|
28
|
+
- name: Install the project
|
|
29
|
+
run: uv sync --locked --all-extras --dev
|
|
30
|
+
|
|
31
|
+
- name: Ruff format check
|
|
32
|
+
run: |
|
|
33
|
+
uvx ruff format --diff ./src/ ./tests/
|
|
34
|
+
|
|
35
|
+
- name: Ruff default rules and import check
|
|
36
|
+
run: |
|
|
37
|
+
uvx ruff check --extend-select I ./src/ ./tests/
|
|
38
|
+
|
|
39
|
+
# - name: Pyright check
|
|
40
|
+
# run: |
|
|
41
|
+
# uvx pyright ./src/
|
|
42
|
+
# tests:
|
|
43
|
+
# runs-on: ubuntu-latest
|
|
44
|
+
# steps:
|
|
45
|
+
# - name: Check Out Repo
|
|
46
|
+
# uses: actions/checkout@v5
|
|
47
|
+
#
|
|
48
|
+
# - name: Install uv
|
|
49
|
+
# uses: astral-sh/setup-uv@v6
|
|
50
|
+
# with:
|
|
51
|
+
# enable-cache: true
|
|
52
|
+
# cache-dependency-glob: "uv.lock"
|
|
53
|
+
#
|
|
54
|
+
# - name: "Set up Python"
|
|
55
|
+
# uses: actions/setup-python@v6
|
|
56
|
+
# with:
|
|
57
|
+
# python-version-file: "pyproject.toml"
|
|
58
|
+
#
|
|
59
|
+
# - name: Install the project
|
|
60
|
+
# run: uv sync --locked --all-extras --all-groups --dev
|
|
61
|
+
#
|
|
62
|
+
# - name: Run unittests
|
|
63
|
+
# run: uv run pytest tests/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# This workflow will upload a Python Package using Twine when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: Build and push release
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
pypi-build-and-push:
|
|
20
|
+
name: Build and push wheel package
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v5
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@v6
|
|
28
|
+
with:
|
|
29
|
+
enable-cache: true
|
|
30
|
+
cache-dependency-glob: "uv.lock"
|
|
31
|
+
|
|
32
|
+
- name: "Set up Python"
|
|
33
|
+
uses: actions/setup-python@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version-file: "pyproject.toml"
|
|
36
|
+
|
|
37
|
+
- name: Install build package
|
|
38
|
+
run: uv pip install --system build setuptools_scm
|
|
39
|
+
|
|
40
|
+
- name: Build package
|
|
41
|
+
run: python -m build
|
|
42
|
+
|
|
43
|
+
- name: Publish package
|
|
44
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
45
|
+
with:
|
|
46
|
+
user: __token__
|
|
47
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Create Release on Tag
|
|
2
|
+
permissions:
|
|
3
|
+
contents: write
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- 'v*'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
create-release:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
if: ${{ startsWith(github.ref, 'refs/tags') }}
|
|
14
|
+
steps:
|
|
15
|
+
- name: Create GitHub Release
|
|
16
|
+
env:
|
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
+
tag: ${{ github.ref_name }}
|
|
19
|
+
run: |
|
|
20
|
+
gh release create "$tag" \
|
|
21
|
+
--repo="$GITHUB_REPOSITORY" \
|
|
22
|
+
--title="v${tag#v}" \
|
|
23
|
+
--generate-notes
|
|
24
|
+
pypi-build-and-push:
|
|
25
|
+
name: Build and push wheel package
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v5
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v6
|
|
33
|
+
with:
|
|
34
|
+
enable-cache: true
|
|
35
|
+
cache-dependency-glob: "uv.lock"
|
|
36
|
+
|
|
37
|
+
- name: "Set up Python"
|
|
38
|
+
uses: actions/setup-python@v6
|
|
39
|
+
with:
|
|
40
|
+
python-version-file: "pyproject.toml"
|
|
41
|
+
|
|
42
|
+
- name: Install build package
|
|
43
|
+
run: uv pip install --system build setuptools_scm
|
|
44
|
+
|
|
45
|
+
- name: Build package
|
|
46
|
+
run: python -m build
|
|
47
|
+
|
|
48
|
+
- name: Publish package
|
|
49
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
50
|
+
with:
|
|
51
|
+
user: __token__
|
|
52
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Temporary and binary files
|
|
2
|
+
*~
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.so
|
|
5
|
+
*.cfg
|
|
6
|
+
!.isort.cfg
|
|
7
|
+
!setup.cfg
|
|
8
|
+
*.orig
|
|
9
|
+
*.log
|
|
10
|
+
*.pot
|
|
11
|
+
__pycache__/*
|
|
12
|
+
.cache/*
|
|
13
|
+
.*.swp
|
|
14
|
+
*/.ipynb_checkpoints/*
|
|
15
|
+
.DS_Store
|
|
16
|
+
|
|
17
|
+
# Project files
|
|
18
|
+
.ropeproject
|
|
19
|
+
.project
|
|
20
|
+
.pydevproject
|
|
21
|
+
.settings
|
|
22
|
+
.idea
|
|
23
|
+
tags
|
|
24
|
+
|
|
25
|
+
# Package files
|
|
26
|
+
*.egg
|
|
27
|
+
*.eggs/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg-info
|
|
30
|
+
|
|
31
|
+
# Unittest and coverage
|
|
32
|
+
htmlcov/*
|
|
33
|
+
.coverage
|
|
34
|
+
.tox
|
|
35
|
+
junit.xml
|
|
36
|
+
coverage.xml
|
|
37
|
+
.pytest_cache/
|
|
38
|
+
|
|
39
|
+
# Build and docs folder/files
|
|
40
|
+
build/*
|
|
41
|
+
dist/*
|
|
42
|
+
sdist/*
|
|
43
|
+
docs/api/*
|
|
44
|
+
docs/_rst/*
|
|
45
|
+
docs/_build/*
|
|
46
|
+
cover/*
|
|
47
|
+
MANIFEST
|
|
48
|
+
|
|
49
|
+
# Per-project virtualenvs
|
|
50
|
+
.venv*/
|
|
51
|
+
|
|
52
|
+
.env
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
3
|
+
rev: 0.9.11
|
|
4
|
+
hooks:
|
|
5
|
+
- id: uv-lock
|
|
6
|
+
# - id: uv-export
|
|
7
|
+
|
|
8
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
9
|
+
rev: v0.14.6
|
|
10
|
+
hooks:
|
|
11
|
+
# Run the linter.
|
|
12
|
+
- id: ruff-check
|
|
13
|
+
args: [ --fix ]
|
|
14
|
+
files: ^(migrations/|src/|tests/).*
|
|
15
|
+
types_or: [ python, pyi ]
|
|
16
|
+
# Run the import sort.
|
|
17
|
+
- id: ruff-check
|
|
18
|
+
args:
|
|
19
|
+
- --select
|
|
20
|
+
- I
|
|
21
|
+
- --fix
|
|
22
|
+
files: ^(migrations/|src/|tests/).*
|
|
23
|
+
types_or: [ python, pyi ]
|
|
24
|
+
# Run the formatter.
|
|
25
|
+
- id: ruff-format
|
|
26
|
+
files: ^(migrations/|src/|tests/).*
|
|
27
|
+
types_or: [ python, pyi ]
|
|
28
|
+
|
|
29
|
+
# - repo: local
|
|
30
|
+
# hooks:
|
|
31
|
+
# - id: pyright
|
|
32
|
+
# name: Run pyright via uvx
|
|
33
|
+
# entry: uvx pyright ./src ./tests
|
|
34
|
+
# language: system
|
|
35
|
+
# pass_filenames: false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
>=3.13.9,<3.15.0
|