-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathpyproject.toml
More file actions
180 lines (159 loc) · 4.92 KB
/
Copy pathpyproject.toml
File metadata and controls
180 lines (159 loc) · 4.92 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# https://docs.astral.sh/uv/reference/settings/
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
# PROJECT
[project]
name = "bikes"
version = "5.0.0"
description = "Predict the number of bikes available."
authors = [{ name = "Médéric HURIER", email = "github@fmind.dev" }]
readme = "README.md"
license = "MIT"
license-files = ["LICENSE.txt"]
keywords = ["mlops", "python", "package"]
requires-python = ">=3.14"
dependencies = [
"loguru>=0.7.3",
"matplotlib>=3.11.0",
"mlflow>=3.14.0",
# numba/numpy/pyarrow/shap are ABI-coupled: keep permissive floors so uv's universal
# (all-platform) resolution stays satisfiable; the lockfile pins the latest tested versions.
"numba>=0.61.0",
"numpy>=2.1.3",
"omegaconf>=2.3.1",
"pandas>=2.3.3", # MLflow 3.x pins pandas<3; pandas 3.0 is held back by MLflow compat
"pandera>=0.32.1",
"plotly>=6.8.0",
"plyer>=2.1.0",
"psutil>=7.2.2",
"pyarrow>=19.0.1",
"pydantic-settings>=2.14.2",
"pydantic>=2.13.4",
"pynvml>=13.0.1",
"scikit-learn>=1.9.0",
"setuptools>=83.0.0",
"shap>=0.46.0",
]
# LINKS
[project.urls]
Homepage = "https://github.com/fmind/mlops-python-package"
Documentation = "https://fmind.github.io/mlops-python-package/bikes.html"
Repository = "https://github.com/fmind/mlops-python-package"
"Bug Tracker" = "https://github.com/fmind/mlops-python-package/issues"
Changelog = "https://github.com/fmind/mlops-python-package/blob/main/CHANGELOG.md"
# SCRIPTS
[project.scripts]
bikes = 'bikes.scripts:main'
# DEPENDENCIES
[dependency-groups]
dev = [
"lefthook>=2.1.9",
"pdoc>=16.0.0",
"pip-audit>=2.9.0",
"pytest>=9.1.1",
"pytest-cov>=7.1.0",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.1",
"ruff>=0.15.0",
"ty>=0.0.56,<0.1", # pre-1.0: pin a compatible range until it stabilizes
"validate-pyproject>=0.25",
]
notebook = ["ipykernel>=6.29.5", "nbformat>=5.10.4"]
# TOOLS
[tool.ruff]
line-length = 120
target-version = "py314"
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
quote-style = "double"
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle (documented public API)
"E", # pycodestyle errors
"ERA", # eradicate (no commented-out code)
"F", # pyflakes
"FA", # flake8-future-annotations
"FURB", # refurb (modern constructs)
"I", # isort (import sorting)
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff-specific rules
"S", # flake8-bandit (security; replaces bandit)
"SIM", # flake8-simplify
"SLF", # flake8-self
"T10", # flake8-debugger
"T20", # flake8-print
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"E501", # line length handled by the formatter
"N812", # project convention: `import typing as T`
"UP040", # some aliases double as runtime constructors (PEP 695 `type` would break them)
"RUF012", # Pydantic copies mutable field defaults per-instance (rule false-positive here)
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"D100", # missing docstring in public module
"D103", # missing docstring in public function
"S101", # asserts allowed in tests
"T201", # prints allowed in tests
"PTH", # os.path allowed in test helpers
"PT003", # explicit scope="function" kept for teaching clarity
"ARG002", # fixtures requested for their side effects
"SLF001", # tests may access internals
]
"notebooks/**" = [
"S101", # asserts allowed in exploratory notebooks
"T201", # prints allowed in exploratory notebooks
]
[tool.ty.environment]
python-version = "3.14"
# `ty` (pre-1.0) does not model Pydantic/pandera/MLflow dynamic typing yet; relax the
# categories they trigger so `ty` still gates real errors (undefined names, bad calls).
[tool.ty.rules]
invalid-argument-type = "ignore" # dynamic ML/MLflow call sites
invalid-frozen-dataclass-subclass = "ignore" # ty reads frozen Pydantic models as frozen dataclasses
invalid-type-form = "ignore" # pandera typed Series / dynamic type forms
not-subscriptable = "ignore" # optional dynamic MLflow attributes
possibly-missing-submodule = "ignore" # lazily-loaded mlflow.* submodules
unresolved-attribute = "ignore" # dynamic attributes on MLflow/pandera objects
[tool.pytest.ini_options]
addopts = [
"-ra",
"--strict-config",
"--strict-markers",
"--cov=src",
"--cov-report=term-missing",
"--cov-fail-under=80",
]
pythonpath = ["src"]
testpaths = ["tests"]
xfail_strict = true
[tool.coverage.run]
branch = true
source = ["src"]
omit = ["__main__.py"]
[tool.coverage.report]
show_missing = true
skip_covered = true
# SYSTEMS
[build-system]
requires = ["uv_build>=0.9.0"]
build-backend = "uv_build"