Compare commits
2 Commits
7cd0d8c229
...
96d56d7f1f
| Author | SHA1 | Date | |
|---|---|---|---|
| 96d56d7f1f | |||
| 048071263a |
34
.pre-commit-config.yaml
Normal file
34
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
repos:
|
||||
- repo: local
|
||||
hooks:
|
||||
# Run the linter.
|
||||
- id: ruff
|
||||
name: ruff
|
||||
language: system
|
||||
exclude: __init__.py
|
||||
types_or: [ python, pyi ]
|
||||
entry: uv run ruff check .
|
||||
args: [ --fix ]
|
||||
# Run the formatter.
|
||||
- id: ruff-format
|
||||
name: ruff-format
|
||||
language: system
|
||||
entry: uv run ruff format
|
||||
types_or: [ python, pyi ]
|
||||
|
||||
# Отсортировывает импорты в проекте
|
||||
- id: isort
|
||||
name: isort
|
||||
language: system
|
||||
exclude: __init__.py
|
||||
entry: uv run isort
|
||||
args: [ --profile, black, --filter-files ]
|
||||
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: uv run mypy
|
||||
require_serial: true
|
||||
language: system
|
||||
types: [ python ]
|
||||
|
||||
|
||||
4
main.py
4
main.py
@@ -1,6 +1,7 @@
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -17,6 +18,5 @@ def main():
|
||||
uvicorn.run(app_factory, factory=True, host="0.0.0.0", port=8000)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -5,6 +5,16 @@ description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"fastapi[standart]>=0.136.0",
|
||||
"fastapi>=0.136.0",
|
||||
"uvicorn>=0.44.0",
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"isort>=8.0.1",
|
||||
"mypy>=1.20.1",
|
||||
"pre-commit>=4.5.1",
|
||||
"pytest>=9.0.3",
|
||||
"pytest-asyncio>=1.3.0",
|
||||
"ruff>=0.15.11",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user