-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
132 lines (118 loc) · 3.89 KB
/
Copy pathpyproject.toml
File metadata and controls
132 lines (118 loc) · 3.89 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
[build-system]
requires = ["setuptools>=83.0.0", "setuptools_scm[toml]>=10.2.1"]
build-backend = "setuptools.build_meta"
[project]
requires-python = ">=3.14,<3.15"
name = "python_template"
# La versión se obtiene automáticamente de git con `setuptools_scm`
#version = "0.1.0"
description = "Aplicación Python de ejemplo"
readme = "README.md"
authors = [{ name = "Komorebi AI", email = "info@komorebi.ai" }]
dynamic = ["version"]
dependencies = [
"fastapi",
"pydantic",
"uvicorn",
"colorlog>=6.9.0",
# uvicorn needs pyyaml to load the YAML log config (log_conf.yaml)
"pyyaml",
"typer",
]
[project.urls]
homepage = "https://github.com/Komorebi-AI/python-template"
[project.scripts]
python_template = "python_template.main:main"
[tool.setuptools]
packages = ["python_template"]
[tool.setuptools_scm]
# Importante crear esta sección vacia para activar el plugin
[tool.uv]
required-version = ">=0.9.17"
# Exclude packages published in the last 7 days to mitigate supply chain attacks
exclude-newer = "7 days"
[tool.ruff]
line-length = 88
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # Pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"I", # isort
"D", # pydocstyle
"C401", # flake8-comprehensions: unnecessary-generator-set
"C402", # flake8-comprehensions: unnecessary-generator-dict
"C403", # flake8-comprehensions: unnecessary-list-comprehension-set
"C404", # flake8-comprehensions: unnecessary-list-comprehension-dict
"C405", # flake8-comprehensions: unnecessary-literal-set
"W605", # pycodestyle: invalid-escape-sequence
"S", # flake8-bandit (security)
"RUF", # ruff-specific rules
"PT", # flake8-pytest-style
"A", # flake8-builtins (no builtin shadowing)
"PERF", # perflint (performance anti-patterns)
"N", # pep8-naming
"RET501", # flake8-return: unnecessary-return-none
"RET502", # flake8-return: implicit-return-value
"RET503", # flake8-return: implicit-return
"RET504", # flake8-return: unnecessary-assign
"PIE", # flake8-pie
"LOG", # flake8-logging
"NPY", # numpy-specific rules
"PD", # pandas-vet
"ISC001", # flake8-implicit-str-concat: single-line implicit string concatenation
"TRY", # tryceratops (exception handling best practices)
"PLE", # pylint errors
"PLW", # pylint warnings
"PLC", # pylint convention
"FAST", # fastapi
]
ignore = [
"B028", # no-explicit-stacklevel
"D100", # undocumented-public-module
"LOG015", # root-logger-call (fine for scripts/apps)
"N803", # invalid-argument-name
"N806", # non-lowercase-variable-in-function
"PD010", # pandas-use-of-dot-pivot-or-unstack
"PERF401", # manual-list-comprehension
"PLC0415", # import-outside-top-level
"RET504", # unnecessary-assign
"RUF001", # ambiguous-unicode-character-string
"RUF005", # collection-literal-concatenation
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
"SIM118", # in-dict-keys
"TRY003", # raise-vanilla-args
"TRY300", # try-consider-else
"TRY400", # error-instead-of-exception
]
[tool.ruff.lint.per-file-ignores]
# Also ignore `D104` in all `__init__.py` files.
"__init__.py" = ["D104"]
"tests/*.py" = ["D", "S101"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.pytest.ini_options]
minversion = "7"
testpaths = ["tests"]
log_cli_level = "INFO"
xfail_strict = true
addopts = ["-ra", "--strict-config", "--strict-markers"]
filterwarnings = ["error", "ignore::DeprecationWarning"]
[tool.deptry]
# colorlog is used in log_conf.yaml (not scanned by deptry); pyyaml is used
# by uvicorn to load log_conf.yaml
per_rule_ignores = {"DEP002" = ["colorlog", "pyyaml"]}
[tool.ty.terminal]
error-on-warning = true
[dependency-groups]
dev = [
"pytest",
"ruff",
"prek",
"ipykernel",
"ty",
"deptry>=0.25",
]