forked from mikepsinn/disease-eradication-plan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
120 lines (109 loc) · 3.83 KB
/
pyproject.toml
File metadata and controls
120 lines (109 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "dih-models"
version = "0.1.0"
description = "How to End War and Disease"
authors = [
{name = "Mike P. Sinn", email = "mike@WarOnDisease.org"}
]
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"pandas",
"numpy",
"numpy-financial",
"matplotlib",
"seaborn",
"plotly",
"PyYAML",
# Jupyter ecosystem for Quarto
"jupyter",
"ipykernel",
"nbformat",
"nbclient",
"jupyter-client",
"jupyter-core",
"traitlets",
"notebook",
"nbconvert",
"ipywidgets",
"jupyterlab",
]
[project.optional-dependencies]
dev = [
"pytest",
# Code quality tools (minimal, practical setup)
"pre-commit", # Git hooks framework
"ruff", # Fast linter/formatter (replaces flake8, black, isort, mypy)
# Legacy (can be removed after migrating to ruff)
"black",
"flake8",
]
[tool.setuptools]
packages = ["dih_models", "dih_models.plotting"]
# Ruff configuration (replaces flake8, black, isort)
[tool.ruff]
line-length = 120
target-version = "py312"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
"E402", # module level import not at top of file (needed for sys.path modifications)
"E203", # whitespace before ':' in slices - Black-compatible formatting like [start :]
"W293", # blank line contains whitespace (trivial, auto-fixed by formatters)
"E722", # bare except (intentional catch-all handlers for robustness)
"B006", # mutable default argument (sometimes intentional for caching)
"B007", # loop control variable not used (common pattern for unpacking)
"B008", # do not perform function calls in argument defaults
"B023", # function definition does not bind loop variable (often intentional closures)
"B033", # duplicate set items (float/int duplicates like 0 and 0.0)
"I001", # import block unsorted (let formatter handle)
"UP006", # use lowercase dict/list for type annotations (Python 3.8 compat)
"UP009", # UTF-8 encoding declaration unnecessary (but harmless)
"UP015", # unnecessary open mode 'r' (explicit is fine)
"UP034", # avoid extraneous parentheses (style preference)
"UP045", # use X | None instead of Optional (Python 3.8 compat)
"C416", # unnecessary dict comprehension (readability preference)
"C420", # unnecessary dict comprehension for dict.fromkeys (readability)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports in __init__.py
"scripts/*.py" = ["E402"] # Allow imports after sys.path modifications
# MyPy configuration
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true
no_strict_optional = true
# Flake8 configuration (disable line-length rule E501)
[tool.flake8]
max-line-length = 120
extend-ignore = [
"E501", # line too long
"E203", # whitespace before ':' - Black-compatible slice formatting
]
# Pyright/Pylance configuration
[tool.pyright]
pythonVersion = "3.12"
typeCheckingMode = "basic" # Less strict than "strict"
reportUnknownParameterType = false # Suppress "type of parameter is unknown" (for Any fallbacks)
reportUnknownArgumentType = false # Suppress "argument type is unknown"
reportUnknownMemberType = false # Suppress unknown member access
reportUnknownVariableType = false # Suppress "type of variable is unknown"
reportMissingTypeStubs = false # Don't complain about missing stubs
reportPrivateUsage = false # Allow accessing _private members
[tool.pytest.ini_options]
testpaths = ["scripts/tests"]