Skip to content

Commit c2083de

Browse files
authored
🔖 Version 2.0.0 of FastAPI Class (#58)
* 🔖 Version 2.0.0 of FastAPI Class * 🐛 Fix Directory name issue * 📌 Drop python 3.7 * 🐛 unsupported `DefaultPlaceholder` * 🐛 fix * 📝 Add Documentation
1 parent 2fee852 commit c2083de

28 files changed

+397
-261
lines changed

.coveragerc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Yezz123

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These are supported funding model platforms
2+
github: [yezz123]

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
version: 2
2+
23
updates:
3-
- package-ecosystem: "pip" # See documentation for possible values
4-
directory: "/" # Location of package manifests
4+
# GitHub Actions
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
57
schedule:
6-
interval: "daily"
8+
interval: "daily"
9+
reviewers:
10+
- yezz123
11+
commit-message:
12+
prefix:
13+
# Python
14+
- package-ecosystem: "pip"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
reviewers:
19+
- yezz123
20+
commit-message:
21+
prefix:

.github/workflows/codeql.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/lint.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint and Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.10"]
16+
fail-fast: false
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install Dependencies
25+
run: pip install -e .[lint]
26+
- name: Lint
27+
run: bash Scripts/format.sh
28+
- name: check Static Analysis
29+
run: bash Scripts/lint.sh

.github/workflows/publish.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to PyPI
1+
name: Publish
22

33
on:
44
release:
@@ -13,28 +13,26 @@ jobs:
1313
env:
1414
GITHUB_CONTEXT: ${{ toJson(github) }}
1515
run: echo "$GITHUB_CONTEXT"
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v4
1919
with:
20-
python-version: "3.9"
21-
- uses: actions/cache@v2
20+
python-version: "3.10"
21+
- uses: actions/cache@v3
2222
id: cache
2323
with:
2424
path: ${{ env.pythonLocation }}
2525
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
26-
- name: Install Flit
26+
- name: Install build dependencies
2727
if: steps.cache.outputs.cache-hit != 'true'
28-
run: pip install flit
29-
- name: Install Dependencies
30-
if: steps.cache.outputs.cache-hit != 'true'
31-
run: flit install --symlink
28+
run: pip install build
29+
- name: Build distribution
30+
run: python -m build
3231
- name: Publish
33-
env:
34-
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
35-
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
36-
run: flit publish
32+
uses: pypa/[email protected]
33+
with:
34+
password: ${{ secrets.PYPI_API_TOKEN }}
3735
- name: Dump GitHub context
3836
env:
3937
GITHUB_CONTEXT: ${{ toJson(github) }}
40-
run: echo "$GITHUB_CONTEXT"
38+
run: echo "$GITHUB_CONTEXT"

.github/workflows/test.yml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Test Suite
22

33
on:
44
push:
@@ -8,44 +8,28 @@ on:
88
types: [opened, synchronize]
99

1010
jobs:
11-
test:
11+
tests:
1212
runs-on: ubuntu-latest
13-
services:
14-
redis:
15-
image: redis
16-
ports:
17-
- 6379:6379
18-
options: >-
19-
--health-cmd "redis-cli ping"
20-
--health-interval 10s
21-
--health-timeout 5s
22-
--health-retries 5
13+
timeout-minutes: 30
2314
strategy:
2415
matrix:
25-
python-version: [3.8, 3.9, 3.10.0]
26-
fail-fast: false
16+
python-version: ["3.8", "3.9", "3.10", "3.11"]
2717

2818
steps:
29-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
3020
- name: Set up Python
31-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
3222
with:
3323
python-version: ${{ matrix.python-version }}
34-
- uses: actions/cache@v2
24+
- uses: actions/cache@v3
3525
id: cache
3626
with:
3727
path: ${{ env.pythonLocation }}
38-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test
39-
- name: Install Flit
40-
if: steps.cache.outputs.cache-hit != 'true'
41-
run: pip install flit
28+
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v02
4229
- name: Install Dependencies
4330
if: steps.cache.outputs.cache-hit != 'true'
44-
run: flit install --symlink
45-
- name: Lint
46-
if: ${{ matrix.python-version != '3.9' }} && ${{ matrix.python-version != '3.8' }}
47-
run: pre-commit run --all-files
48-
- name: Test
49-
run: python -m pytest --cov=fastapi_class
31+
run: pip install -e .[test]
32+
- name: Test with pytest
33+
run: bash Scripts/test.sh
5034
- name: Upload coverage
51-
uses: codecov/codecov-action@v1
35+
uses: codecov/codecov-action@v1

.pre-commit-config.yaml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
13
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.2.0
4-
hooks:
5-
- id: check-merge-conflict
6-
- id: check-added-large-files
7-
- id: check-ast
8-
- id: check-symlinks
9-
- id: trailing-whitespace
10-
- id: check-json
11-
- id: debug-statements
12-
- id: pretty-format-json
13-
args: ["--autofix", "--allow-missing-credentials"]
14-
- repo: https://github.com/PyCQA/isort
15-
rev: 5.10.1
16-
hooks:
17-
- id: isort
18-
args: ["--profile", "black"]
19-
- repo: https://github.com/PyCQA/flake8
20-
rev: 4.0.1
21-
hooks:
22-
- id: flake8
23-
additional_dependencies: [flake8-print]
24-
files: '\.py$'
25-
exclude: docs/
26-
args:
27-
- --select=F403,F406,F821,T003
28-
- repo: https://github.com/humitos/mirrors-autoflake
29-
rev: v1.3
30-
hooks:
31-
- id: autoflake
32-
files: '\.py$'
33-
exclude: '^\..*'
34-
args: ["--in-place"]
35-
- repo: https://github.com/psf/black
36-
rev: 22.3.0
37-
hooks:
38-
- id: black
39-
args: ["--target-version", "py38"]
40-
- repo: https://github.com/asottile/pyupgrade
41-
rev: v2.31.1
42-
hooks:
43-
- id: pyupgrade
44-
args: [--py37-plus]
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: check-added-large-files
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/asottile/pyupgrade
15+
rev: v3.2.2
16+
hooks:
17+
- id: pyupgrade
18+
args:
19+
- --py3-plus
20+
- --keep-runtime-typing
21+
- repo: https://github.com/charliermarsh/ruff-pre-commit
22+
rev: v0.0.138
23+
hooks:
24+
- id: ruff
25+
args:
26+
- --fix
27+
- repo: https://github.com/pycqa/isort
28+
rev: 5.10.1
29+
hooks:
30+
- id: isort
31+
name: isort (python)
32+
- id: isort
33+
name: isort (cython)
34+
types: [cython]
35+
- id: isort
36+
name: isort (pyi)
37+
types: [pyi]
38+
- repo: https://github.com/psf/black
39+
rev: 22.10.0
40+
hooks:
41+
- id: black
42+
ci:
43+
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
44+
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate

0 commit comments

Comments
 (0)