-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
246 lines (221 loc) · 8.26 KB
/
Copy pathpyproject.toml
File metadata and controls
246 lines (221 loc) · 8.26 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# pyproject.toml — bib2graph
#
# Núcleo construido (Hitos 1–6): biblioteca viva DuckDB + cliente OpenAlex
# sobre httpx (ADR 0007/0009), redes, sources, forrajeo y CLI b2g. Extras
# opt-in declarados; [bibtex] poblado, el resto vacío hasta su hito. Tooling
# LOCAL estándar (ruff, mypy, pytest, pre-commit, commitizen) configurado desde
# el día uno (ADR 0006/0010). CI (.github/workflows/ci.yml) y release-please
# (.github/workflows/release-please.yml) YA están conectados; la publicación a
# PyPI está conectada desde 0.10.0 vía Trusted Publishing/OIDC
# (.github/workflows/publish-pypi.yml, invocado por release-please). Ver VERSIONING.md.
#
# Ver:
# - docs/ARCHITECTURE.md
# - docs/API.md
# - docs/ROADMAP/
# - docs/decisiones/0007-openalex-backbone.md (OpenAlex backbone)
# - docs/decisiones/0009-biblioteca-viva-duckdb.md (DuckDB en el núcleo)
# - docs/decisiones/0005-dependencias-extras.md (matriz de extras)
[build-system]
requires = ["hatchling>=1.18"]
build-backend = "hatchling.build"
[project]
name = "bib2graph"
version = "0.11.0" # Hitos 7 (dedup) + 8 (co-citación). De acá en adelante el bump
# lo maneja release-please vía PR de release (CI ya conectado).
description = "Librería de Python para transformar corpus bibliográficos en redes bibliométricas reproducibles (co-citación, colaboración, co-ocurrencia)."
readme = "README.md"
requires-python = ">=3.11"
license = { text = "GPL-3.0-or-later" }
authors = [
{ name = "Equipo bib2graph" },
]
keywords = ["bibliometrics", "co-citation", "network-analysis", "bibtex", "reproducible-research"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Text Processing :: Markup",
]
dependencies = [
"pyarrow>=15",
# tabla canónica (ADR 0006)
"pydantic>=2.6",
# validación del wrapper Corpus y Manifest
"networkx>=3.2",
# grafos
"click>=8.1",
# CLI agente-native (ADR 0010)
"tqdm>=4.66",
# progreso
"duckdb>=0.10",
# biblioteca viva, persistencia por defecto (ADR 0009)
"httpx>=0.27",
# cliente OpenAlex backbone; testeable con MockTransport (ADR 0007)
"python-louvain>=0.16",
# comunidades Louvain; DECLARADO, nunca usado sin declarar (lección 7)
"pyyaml>=6.0.3",
# parser de specs declarativas (NetworkSpec YAML, Hito 9)
"rapidfuzz>=3,<4",
# dedup fuzzy determinista (core desde #88; antes extra [dedup])
]
[project.optional-dependencies]
# zotero/neo4j: ex-Hito 11, DESCARTADO (PO 2026-06-17). Se reabrirían como hito
# nuevo si hay demanda real; no se declaran como extras vacíos engañosos.
s2 = []
neo4j = []
viz = []
bibtex = [
"bibtexparser>=1.4.4",
]
[project.urls]
Homepage = "https://github.com/complexluise/bib2graph"
Repository = "https://github.com/complexluise/bib2graph"
Documentation = "https://github.com/complexluise/bib2graph/tree/main/docs"
Changelog = "https://github.com/complexluise/bib2graph/blob/main/CHANGELOG.md"
Issues = "https://github.com/complexluise/bib2graph/issues"
[project.scripts]
# CLI entry point. Hito 6: implementación real del CLI agente-native.
# El paquete bib2graph.cli (antes cli.py) expone main() en __init__.py.
b2g = "bib2graph.cli:main"
# Alias deprecado del ejecutable legado 'bib2graph' (ADR 0038, #165).
# Emite aviso a stderr y delega en main(). Se retira en 0.11.0.
bib2graph = "bib2graph.cli:main_bib2graph_alias"
# ----- Build (hatchling, src layout) --------------------------------------
[tool.hatch.build.targets.wheel]
packages = ["src/bib2graph"]
# El sdist incluye fuente, tests y docs para reproducibilidad, pero NO el sandbox
# de exploración (datos de investigación IED: CSV/parquet/graphml) ni los binarios
# pesados de referencia: son del repo, no del paquete distribuible.
[tool.hatch.build.targets.sdist]
exclude = [
"exploracion",
".claude",
"docs/Notas/03-referencia",
]
# ----- uv (gestor del proyecto) -------------------------------------------
# Dependencias de desarrollo gestionadas por uv: NO se publican en PyPI (a
# diferencia de un extra). `uv sync` las instala por defecto; `uv sync --no-dev`
# instala solo el núcleo. Agregar deps con `uv add` / `uv add --dev`.
[dependency-groups]
# PEP 735: reemplaza el deprecado [tool.uv] dev-dependencies (#125). uv instala
# el grupo `dev` por defecto en `uv sync`. Agregar deps con `uv add --dev`.
dev = [
"pytest>=8",
"pytest-cov>=4",
"mypy>=1.8",
"ruff>=0.3",
"pre-commit>=3.6",
"commitizen>=3.13",
"types-tqdm",
"types-networkx>=3.6.1.20260612",
"types-pyyaml>=6.0.12.20260518",
]
# Sitio de documentación (MkDocs Material). Solo para construir docs en local y
# en CI (.github/workflows/docs.yml); no se publica a PyPI. `uv sync --group docs`.
# La referencia de API/CLI se autogenera del código: mkdocstrings (librería,
# desde docstrings) y mkdocs-click (CLI b2g, desde el grupo Click). termynal
# anima las sesiones de terminal del quickstart.
docs = [
"mkdocs-material>=9.5",
"mkdocs-include-markdown-plugin>=6",
"mkdocstrings[python]>=0.24",
"mkdocs-click>=0.8",
"termynal>=0.12",
]
# ----- Tooling ------------------------------------------------------------
[tool.ruff]
line-length = 88
target-version = "py311"
# exploracion/ es el sandbox de investigación (no es el paquete; ya excluido del
# sdist y del gate de mypy). Se excluye del lint/format para que CI y el gate local
# concuerden sobre el código publicable (src/ + tests/).
extend-exclude = [".venv", "build", "dist", "exploracion"]
[tool.ruff.lint]
# Reglas activas. Select conservador al ppio; se expande en Hito 2 cuando
# haya código real.
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (orden de imports)
"B", # bugbear
"UP", # pyupgrade (sintaxis moderna)
"SIM", # simplificaciones
"RUF", # reglas ruff específicas
]
ignore = [
"E501", # line length (lo maneja ruff format)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["B011"] # asserts en tests están bien
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
python_version = "3.11"
strict = true
warn_unused_configs = true
warn_return_any = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
plugins = ["pydantic.mypy"]
# Cobertura gradual: el núcleo es estricto. Los overrides para extras con stubs
# faltantes (enrichers, stores.neo4j) se agregan cuando esos módulos existan.
[[tool.mypy.overrides]]
module = "bibtexparser.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "rapidfuzz.*"
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=bib2graph",
"--cov-report=term-missing",
"-m",
"not network and not slow",
]
markers = [
"unit: tests puros, sin red ni I/O (default)",
"integration: tests con I/O local (duckdb/store); corren en el gate",
"network: tests que requieren red real (p.ej. OpenAlex); excluidos del gate por defecto (correr con -m network)",
"slow: benchmarks de escala (50 K+ filas); excluidos del gate por defecto (correr con -m slow)",
]
[tool.coverage.run]
branch = true
source = ["src/bib2graph"]
omit = [
"src/bib2graph/__init__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
# ----- Commitizen (Conventional Commits + versionado) --------------------
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.3.0"
version_files = [
"pyproject.toml:version",
]
tag_format = "v$version"
changelog_file = "CHANGELOG.md"
# Mapeo de tipos a secciones del CHANGELOG (Keep a Changelog style).
update_changelog_on_bump = true
# Mensaje de bump cuando hay BREAKING.
bump_message = "bump: version $current_version → $new_version"
# Conventional Commits en español: tipos y descripciones.
# commitizen los acepta en inglés igual; los defaults son razonables.