This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLUGIN]: Initial FastAPI Integration
- Loading branch information
Showing
34 changed files
with
2,679 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[flake8] | ||
exclude = fixtures, __jac_gen__ | ||
plugins = flake8_import_order, flake8_docstrings, flake8_comprehensions, flake8_bugbear, flake8_annotations, pep8_naming, flake8_simplify | ||
max-line-length = 120 | ||
ignore = E203, W503, ANN101, ANN102 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Linting and Pre-commit checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
|
||
- name: Run pre-commit hooks | ||
run: pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Run Plugin Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
image: redis | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 6379:6379 | ||
steps: | ||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-replica-set: test-rs | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.12.2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install -e . | ||
- name: Run tests | ||
run: | | ||
jac run jaclang_jaseci/tests/fixtures/simple_walkerapi.jac &; | ||
limit=5; count=0; while [ $(curl -s -o /dev/null -w "%{http_code}" http://0.0.0.0:8000/healthz) -ne 200 ] && [ $count -lt $limit ]; do sleep 1; ((count++)); done; if [ $count -ge 5 ]; then echo "Attempted $count times, exiting..."; exit 1; fi | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Django # | ||
*.log | ||
*.pot | ||
*.pyc | ||
__pycache__ | ||
db.sqlite3 | ||
media | ||
migrations | ||
venv | ||
__jac_gen__/ | ||
*.jir | ||
|
||
# Distribution / packaging | ||
.Python | ||
play/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# Others # | ||
.env | ||
.coverage | ||
.session | ||
.DS_Store | ||
build | ||
.vscode | ||
*Zone.Identifier | ||
.DS_Store | ||
parser.out | ||
codegen_output* | ||
|
||
*.rdb | ||
node_modules | ||
out.dot | ||
out.txt | ||
|
||
# Mypy files # | ||
.mypy_cache* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
args: [--allow-multiple-documents] | ||
- id: check-json | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 24.1.1 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [pep8-naming, flake8_import_order, flake8_docstrings, flake8_comprehensions, flake8_bugbear, flake8_annotations, flake8_simplify] | ||
exclude: "examples|vendor" | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
exclude: 'venv|__jac_gen__|tests|stubs|support|vendor|examples/reference|setup.py' | ||
args: | ||
- --follow-imports=silent | ||
- --ignore-missing-imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# DEPENDENCIES | ||
|
||
pip install jaclang black pre-commit pytest flake8 flake8_import_order flake8_docstrings flake8_comprehensions flake8_bugbear flake8_annotations pep8_naming flake8_simplify | ||
pre-commit install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""JacLang FastAPI.""" | ||
|
||
from dotenv import load_dotenv | ||
|
||
from .core import FastAPI | ||
|
||
|
||
load_dotenv() | ||
|
||
start = FastAPI.start | ||
|
||
__all__ = ["FastAPI", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Collection Integration References.""" | ||
|
||
from .base import BaseCollection | ||
from .user import UserCollection | ||
|
||
__all__ = ["BaseCollection", "UserCollection"] |
Oops, something went wrong.