first commit

This commit is contained in:
2025-11-30 00:07:24 +01:00
commit b5e642aecb
78 changed files with 15162 additions and 0 deletions

183
pyproject.toml Normal file
View File

@ -0,0 +1,183 @@
[project]
name = "wlkns-auth"
version = "1.0.0"
description = "Production-ready OpenID Connect (OIDC) Identity Provider built with Flask"
authors = [
{name = "Your Name", email = "your.email@example.com"},
]
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
dependencies = [
"Flask>=3.0.0",
"Flask-SQLAlchemy>=3.1.1",
"Flask-Migrate>=4.0.7",
"Flask-Limiter>=4.0.0",
"PyJWT>=2.8.0",
"bcrypt>=4.1.2",
"psycopg2-binary>=2.9.9",
"python-dotenv>=1.2.1",
"cryptography>=42.0.8",
"pydantic>=2.0.0",
"pydantic[email]>=2.0.0",
"requests>=2.31.0",
"gunicorn>=21.2.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-flask>=1.2.0",
"black>=23.0.0",
"ruff>=0.1.0",
"mypy>=1.5.0",
]
[build-system]
requires = ["setuptools>=68.0.0", "wheel"]
build-backend = "setuptools.build_meta"
# ==========================================
# Black Configuration (Code Formatter)
# ==========================================
[tool.black]
line-length = 100
target-version = ['py310', 'py311']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.venv
| venv
| \.mypy_cache
| \.pytest_cache
| \.ruff_cache
| __pycache__
| build
| dist
| migrations
)/
'''
# ==========================================
# Ruff Configuration (Linter)
# ==========================================
[tool.ruff]
line-length = 100
target-version = "py310"
# Enable specific rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import sorting)
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by black)
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"W191", # indentation contains tabs
]
# Exclude specific directories
exclude = [
".git",
".venv",
"venv",
"__pycache__",
"build",
"dist",
"migrations",
".mypy_cache",
".pytest_cache",
".ruff_cache",
]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports in __init__.py
[tool.ruff.isort]
known-first-party = ["app", "models", "config"]
# ==========================================
# MyPy Configuration (Type Checker)
# ==========================================
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false # Set to true when ready for strict typing
ignore_missing_imports = true
# Specific module overrides
[[tool.mypy.overrides]]
module = "app.services.*"
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = "app.repositories.*"
disallow_untyped_defs = true
# Ignore type checking for certain modules
[[tool.mypy.overrides]]
module = [
"flask_sqlalchemy",
"flask_limiter",
"flask_migrate",
"bcrypt",
]
ignore_missing_imports = true
# ==========================================
# Pytest Configuration (Testing)
# ==========================================
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--verbose",
"--cov=app",
"--cov=models",
"--cov-report=html",
"--cov-report=term-missing",
"--cov-fail-under=0", # Set to desired coverage percentage
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
# ==========================================
# Coverage Configuration
# ==========================================
[tool.coverage.run]
source = ["app", "models", "config"]
omit = [
"*/tests/*",
"*/migrations/*",
"*/__pycache__/*",
"*/venv/*",
"*/.venv/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]