mypy and ruff changes.
This commit is contained in:
1 parent
ba97abf0c5
commit
770fd0c6dd
57 files changed
+563
-398
No files matched your search
+72
-80
@@ -1,3 +1,34 @@
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.mypy]
|
||||
# --strict
|
||||
|
||||
# Good safety defaults
|
||||
warn_return_any = true
|
||||
warn_unused_configs = true
|
||||
warn_redundant_casts = true
|
||||
warn_unused_ignores = true
|
||||
no_implicit_optional = true
|
||||
strict_equality = true
|
||||
# Practical ergonomics
|
||||
pretty = true
|
||||
show_error_codes = true
|
||||
show_column_numbers = true
|
||||
error_summary = true
|
||||
# These keep signal high in real-world FastAPI projects
|
||||
disallow_any_generics = true
|
||||
check_untyped_defs = true
|
||||
# Start here; tighten later
|
||||
disallow_untyped_calls = true
|
||||
disallow_incomplete_defs = true
|
||||
disallow_subclassing_any = true
|
||||
disallow_untyped_defs = true
|
||||
disallow_untyped_decorators = true
|
||||
plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"]
|
||||
# --strict end
|
||||
|
||||
[tool.poetry]
|
||||
name = "brewman"
|
||||
version = "14.0.0"
|
||||
@@ -5,49 +36,51 @@ description = "Accounting plus inventory management for a restaurant."
|
||||
authors = ["tanshu <git@tanshu.com>"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.14"
|
||||
uvicorn = {extras = ["standard"], version = "^0.41.0"}
|
||||
fastapi = {extras = ["all"], version = "^0.129.0"}
|
||||
passlib = {extras = ["bcrypt"], version = "^1.7.4"}
|
||||
psycopg = {extras = ["binary", "pool"], version = "^3.3.2"}
|
||||
SQLAlchemy = "^2.0.46"
|
||||
python-multipart = "^0.0.22"
|
||||
PyJWT = "^2.11.0"
|
||||
SQLAlchemy = "^2.0.46"
|
||||
alembic = "^1.18.4"
|
||||
itsdangerous = "^2.2.0"
|
||||
python-dotenv = "^1.2.1"
|
||||
pydantic = {extras = ["dotenv"], version = "^2.12.5"}
|
||||
pandas = "^3.0.1"
|
||||
arq = "^0.27.0"
|
||||
openpyxl = "^3.1.5"
|
||||
cryptography = "^46.0.5"
|
||||
fastapi = { extras = ["all"], version = "^0.129.0" }
|
||||
gunicorn = "^25.1.0"
|
||||
itsdangerous = "^2.2.0"
|
||||
openpyxl = "^3.1.5"
|
||||
pandas = "^3.0.1"
|
||||
passlib = { extras = ["bcrypt"], version = "^1.7.4" }
|
||||
psycopg = { extras = ["binary", "pool"], version = "^3.3.2" }
|
||||
pydantic = { extras = ["dotenv"], version = "^2.12.5" }
|
||||
python = "^3.14"
|
||||
python-dotenv = "^1.2.1"
|
||||
python-multipart = "^0.0.22"
|
||||
uvicorn = { extras = ["standard"], version = "^0.41.0" }
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pre-commit = "^4.5.1"
|
||||
mypy = "^1.19.1"
|
||||
ruff = "^0.15.1"
|
||||
bandit = "^1.9.3"
|
||||
mypy = "^1.19.1"
|
||||
pre-commit = "^4.5.1"
|
||||
ruff = "^0.15.1"
|
||||
# safety = "^3.7.0"
|
||||
types-openpyxl = "^3.1.5.20250919"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
[tool.pydantic-mypy]
|
||||
init_forbid_extra = true
|
||||
init_typed = true
|
||||
warn_required_dynamic_aliases = true
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
# Assume Python 3.14.
|
||||
target-version = "py314"
|
||||
exclude = [
|
||||
".eggs",
|
||||
".git",
|
||||
".hg",
|
||||
".mypy_cache",
|
||||
".tox",
|
||||
".venv",
|
||||
"_build",
|
||||
"buck-out",
|
||||
"build",
|
||||
".eggs",
|
||||
".git",
|
||||
".hg",
|
||||
".mypy_cache",
|
||||
".tox",
|
||||
".venv",
|
||||
"_build",
|
||||
"buck-out",
|
||||
"build",
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
@@ -56,24 +89,22 @@ exclude = [
|
||||
# McCabe complexity (`C901`) by default.
|
||||
# select = ["E4", "E7", "E9", "F"]
|
||||
select = [
|
||||
# pycodestyle
|
||||
"E",
|
||||
# Pyflakes
|
||||
"F",
|
||||
# pyupgrade
|
||||
"UP",
|
||||
# flake8-bugbear
|
||||
# "B",
|
||||
# flake8-simplify
|
||||
"SIM",
|
||||
# isort
|
||||
"I",
|
||||
# pycodestyle
|
||||
"E",
|
||||
# Pyflakes
|
||||
"F",
|
||||
# pyupgrade
|
||||
"UP",
|
||||
# flake8-bugbear
|
||||
# "B",
|
||||
# flake8-simplify
|
||||
"SIM",
|
||||
# isort
|
||||
"I",
|
||||
]
|
||||
ignore = ["E203", "E501"]
|
||||
|
||||
# Allow fix for all enabled rules (when `--fix`) is provided.
|
||||
fixable = ["ALL"]
|
||||
|
||||
# Avoid trying to fix flake8-bugbear (`B`) violations.
|
||||
unfixable = ["B", "F401"]
|
||||
|
||||
@@ -86,48 +117,9 @@ lines-between-types = 1
|
||||
[tool.ruff.format]
|
||||
# Like Black, use double quotes for strings.
|
||||
quote-style = "double"
|
||||
|
||||
# Like Black, indent with spaces, rather than tabs.
|
||||
indent-style = "space"
|
||||
|
||||
# Like Black, respect magic trailing commas.
|
||||
skip-magic-trailing-comma = false
|
||||
|
||||
# Like Black, automatically detect the appropriate line ending.
|
||||
line-ending = "auto"
|
||||
|
||||
[tool.mypy]
|
||||
# --strict
|
||||
|
||||
# Good safety defaults
|
||||
warn_return_any = true
|
||||
warn_unused_configs = true
|
||||
warn_redundant_casts = true
|
||||
warn_unused_ignores = true
|
||||
no_implicit_optional = true
|
||||
strict_equality = true
|
||||
|
||||
# Practical ergonomics
|
||||
pretty = true
|
||||
show_error_codes = true
|
||||
show_column_numbers = true
|
||||
error_summary = true
|
||||
|
||||
# These keep signal high in real-world FastAPI projects
|
||||
disallow_any_generics = true
|
||||
check_untyped_defs = true
|
||||
|
||||
# Start here; tighten later
|
||||
disallow_untyped_calls = true
|
||||
disallow_incomplete_defs = true
|
||||
disallow_subclassing_any = true
|
||||
disallow_untyped_defs = true
|
||||
disallow_untyped_decorators = true
|
||||
|
||||
plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"]
|
||||
# --strict end
|
||||
|
||||
[tool.pydantic-mypy]
|
||||
init_forbid_extra = true
|
||||
init_typed = true
|
||||
warn_required_dynamic_aliases = true
|
||||
Reference in new issue
Block a user