Skip to content

Commit

Permalink
🔖 Version 2.0.0 of FastAPI Class (#58)
Browse files Browse the repository at this point in the history
* 🔖 Version 2.0.0 of FastAPI Class

* 🐛 Fix Directory name issue

* 📌 Drop python 3.7

* 🐛 unsupported `DefaultPlaceholder`

* 🐛 fix

* 📝 Add Documentation
  • Loading branch information
yezz123 authored Jan 8, 2023
1 parent 2fee852 commit c2083de
Show file tree
Hide file tree
Showing 28 changed files with 397 additions and 261 deletions.
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Yezz123
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These are supported funding model platforms
github: [yezz123]
4 changes: 0 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

21 changes: 18 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
version: 2

updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "daily"
reviewers:
- yezz123
commit-message:
prefix:
# Python
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
reviewers:
- yezz123
commit-message:
prefix:
41 changes: 0 additions & 41 deletions .github/workflows/codeql.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint and Format

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: pip install -e .[lint]
- name: Lint
run: bash Scripts/format.sh
- name: check Static Analysis
run: bash Scripts/lint.sh
28 changes: 13 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI
name: Publish

on:
release:
Expand All @@ -13,28 +13,26 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/cache@v2
python-version: "3.10"
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install Flit
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install flit
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: flit install --symlink
run: pip install build
- name: Build distribution
run: python -m build
- name: Publish
env:
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: flit publish
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
run: echo "$GITHUB_CONTEXT"
40 changes: 12 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Test Suite

on:
push:
Expand All @@ -8,44 +8,28 @@ on:
types: [opened, synchronize]

jobs:
test:
tests:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
timeout-minutes: 30
strategy:
matrix:
python-version: [3.8, 3.9, 3.10.0]
fail-fast: false
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test
- name: Install Flit
if: steps.cache.outputs.cache-hit != 'true'
run: pip install flit
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v02
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: flit install --symlink
- name: Lint
if: ${{ matrix.python-version != '3.9' }} && ${{ matrix.python-version != '3.8' }}
run: pre-commit run --all-files
- name: Test
run: python -m pytest --cov=fastapi_class
run: pip install -e .[test]
- name: Test with pytest
run: bash Scripts/test.sh
- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v1
86 changes: 43 additions & 43 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-merge-conflict
- id: check-added-large-files
- id: check-ast
- id: check-symlinks
- id: trailing-whitespace
- id: check-json
- id: debug-statements
- id: pretty-format-json
args: ["--autofix", "--allow-missing-credentials"]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-print]
files: '\.py$'
exclude: docs/
args:
- --select=F403,F406,F821,T003
- repo: https://github.com/humitos/mirrors-autoflake
rev: v1.3
hooks:
- id: autoflake
files: '\.py$'
exclude: '^\..*'
args: ["--in-place"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: ["--target-version", "py38"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: check-yaml
args:
- --unsafe
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
hooks:
- id: pyupgrade
args:
- --py3-plus
- --keep-runtime-typing
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.138
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
Loading

0 comments on commit c2083de

Please sign in to comment.