-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
163 lines (142 loc) · 3.99 KB
/
Copy pathpyproject.toml
File metadata and controls
163 lines (142 loc) · 3.99 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
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "universal-iiif"
version = "0.27.2"
description = "Scriptoria — a research workbench for IIIF manuscripts."
readme = "README.md"
requires-python = ">=3.10"
license = { text = "GPL-3.0-or-later" }
dependencies = [
"python-fasthtml>=0.14.1",
"uvicorn",
"python-multipart",
"python-dotenv",
"defusedxml",
"Pillow>=10.0.0",
"pandas",
"requests>=2.31.0",
"beautifulsoup4",
"tqdm>=4.66.0",
"PyMuPDF",
"img2pdf>=0.5.1",
"openai",
"anthropic",
"Brotli",
]
[project.urls]
Homepage = "https://github.com/nikazzio/scriptoria"
Repository = "https://github.com/nikazzio/scriptoria"
[tool.setuptools.packages.find]
where = ["src"]
[tool.ruff]
# Manteniamo le tue impostazioni base
line-length = 120
target-version = "py310"
# Cartelle escluse dal linting
exclude = [
".git",
".ruff_cache",
".venv",
"venv",
"__pycache__",
"downloads",
"logs",
"models",
"temp_images",
"build",
"dist",
]
[tool.ruff.lint]
# 1. REGOLE ATTIVATE (Select)
# Abbiamo ampliato drasticamente il controllo
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # Isort (ordinamento import automatico)
"N", # Pep8-naming (nomi classi/funzioni)
"UP", # Pyupgrade (sintassi moderna)
"B", # Bugbear (scova bug logici)
"S", # Bandit (SICUREZZA)
"D", # Pydocstyle (DOCUMENTAZIONE obbligatoria)
"SIM", # Simplify (semplificazione codice)
"A", # Builtins (evita sovrascrittura nomi nativi)
"PTH", # Pathlib (obbliga all'uso di Path invece di os.path)
"C90", # McCabe (complessità ciclica)
]
# 2. REGOLE IGNORATE
# Utile per non essere troppo bloccati durante lo sviluppo rapido
ignore = [
"D100", # Manca docstring nel modulo
"D104", # Manca docstring nel pacchetto (__init__.py)
"D203", # Conflitto spaziature docstring
"D213", # Conflitto spaziature docstring
"S101", # Permette l'uso di assert (fondamentale per i test)
]
[tool.ruff.lint.pydocstyle]
convention = "google" # Standard per le docstring
[tool.ruff.lint.mccabe]
max-complexity = 10 # Ti avvisa se una funzione è troppo "ingarbugliata"
[tool.ruff.lint.per-file-ignores]
# Manteniamo il tuo ignore specifico per i test
"tests/**/*.py" = ["E402", "S101", "D100", "D101", "D102", "D103", "D104", "S108"]
[tool.ruff.format]
# Configurazione per il formatter (stile Black)
quote-style = "double"
indent-style = "space"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
timeout = 60
testpaths = ["tests"]
python_files = "test_*.py"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests requiring external services",
"unit: fast unit tests without external dependencies",
]
[tool.coverage.run]
source = ["src"]
omit = [
"src/universal_iiif.egg-info/*",
"src/*/__pycache__/*",
]
[tool.coverage.report]
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.",
"if TYPE_CHECKING:",
]
[tool.coverage.json]
output = "coverage.json"
[tool.pyright]
include = ["src"]
exclude = ["**/node_modules", "**/__pycache__"]
venv = ".venv"
# Regole: parti leggero o vai su "strict" se il progetto è nuovo
typeCheckingMode = "basic" # o "strict" per masochisti/perfezionisti
reportUnknownVariableType = "none"
reportUnknownMemberType = "none"
reportUnknownArgumentType = "none"
reportMissingTypeStubs = "none"
# Aiuta l'agente a non fare confusione con le importazioni
reportMissingImports = true
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
version_variables = ["src/universal_iiif_core/__init__.py:__version__"]
assets = []
tag_format = "v{version}"
major_on_zero = false
allow_zero_version = true
build_command = ""
[tool.semantic_release.branches.main]
match = "main"
[project.scripts]
scriptoria = "studio_app:main"
scriptoria-cli = "universal_iiif_cli.cli:main"
iiif-studio = "studio_app:main"
iiif-cli = "universal_iiif_cli.cli:main"