NBA-Fantasy-Game / pyproject.toml
Hatmanstack
fix: resolve linting errors and update ruff config
5c113ef
[project]
name = "streamlit-nba"
version = "1.1.0"
description = "NBA team builder and game prediction Streamlit application"
license = {text = "Apache-2.0"}
requires-python = ">=3.11"
dependencies = [
"streamlit>=1.28.0",
"tensorflow>=2.15.0",
"numpy>=1.24.0",
"pandas>=2.0.0",
"pydantic>=2.5.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"mypy>=1.7.0",
"ruff>=0.1.6",
"pandas-stubs>=2.0.0",
]
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
# Third-party library ignores
[[tool.mypy.overrides]]
module = [
"streamlit.*",
"tensorflow.*",
"keras.*",
"sklearn.*",
"scikeras.*",
"pydantic.*",
"pydantic_core.*",
"numpy.*",
]
ignore_missing_imports = true
[tool.ruff]
target-version = "py311"
line-length = 88
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"PL", # pylint
"RUF", # ruff-specific
"S", # flake8-bandit (security)
]
ignore = [
"S101", # assert used (ok in tests)
"PLR0913", # too many arguments
"S608", # SQL injection false positive (using parameterized queries)
"S110", # try-except-pass ok for connection cleanup
"SIM105", # prefer explicit try-except over contextlib.suppress
"PLR2004", # magic numbers ok in game logic
"S311", # standard pseudo-random generators ok for game logic
"E501", # line length (handled by formatter or ignored)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "ARG001", "ARG002", "PLR2004", "PLC0415"]
"debug_streamlit.py" = ["E402"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = [
"-v",
"--tb=short",
"--strict-markers",
]
[tool.coverage.run]
source = ["src"]
branch = true
omit = [
"tests/*",
"scripts/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
]
fail_under = 50