-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
73 lines (67 loc) · 3.5 KB
/
pyproject.toml
File metadata and controls
73 lines (67 loc) · 3.5 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
# -- Project metadata ----------------------------------------------------------
# [project] defines the package name, version, Python version constraint, and
# runtime dependencies. pip / uv reads this to know what to install.
[project]
name = "prim-api"
version = "0.1.0"
description = "Auto-sync PRIM API specs, generate Python clients, sync & validate Opendatasoft datasets"
license = "MIT"
requires-python = ">=3.12"
dependencies = [
"httpx>=0.27", # HTTP client (async-capable, used for all network requests)
"pyyaml>=6.0", # YAML parser (reads manifests/*.yml)
"typer>=0.12", # CLI framework (decorators turn functions into commands)
"jsonschema>=4.21", # JSON Schema validator (validates dataset records)
"rich>=13.7", # Rich terminal output (colours, panels, progress bars)
"pydantic>=2.0", # Data validation (required by generated OpenAPI clients)
"python-dateutil>=2.5.3", # Date parsing (required by generated clients)
"urllib3>=1.25.3,<2.1.0", # HTTP lib (required by generated clients, pinned for compat)
]
# -- Console entry points ------------------------------------------------------
# Maps command names to Typer app objects. After `uv sync` or `pip install -e .`
# you can run e.g. `sync-specs --dry-run` directly from the shell.
[project.scripts]
sync-specs = "tools.sync_specs:app"
generate-clients = "tools.generate_clients:app"
sync-datasets = "tools.sync_datasets:app"
validate-datasets = "tools.validate_datasets:app"
sync-all = "tools.sync_all:app"
# -- Pytest configuration ------------------------------------------------------
# testpaths: only look for tests in tests/.
# pythonpath: adds repo root (".") and the generated client directory to
# sys.path so that `import tools.sync_specs` and `import idfm_ivtr_requete_unitaire`
# work without installing the packages.
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = [".", "generated/clients/idfm_ivtr_requete_unitaire"]
# -- Setuptools packaging ------------------------------------------------------
# Only include the prim_api package (not tools/, tests/, samples/) when building
# a distributable wheel.
[tool.setuptools.packages.find]
include = ["prim_api*"]
# -- Ruff linter & formatter ---------------------------------------------------
# line-length: max 100 chars (ruff enforces this for both lint and format).
# target-version: enables Python 3.12 syntax checks (e.g. `X | Y` union types).
# exclude: skip generated client code — it is machine-written and not ours to lint.
[tool.ruff]
line-length = 100
target-version = "py312"
exclude = ["generated/clients/"]
# select: which rule families to enable.
# E = pycodestyle errors, F = Pyflakes, I = isort (import sorting),
# N = pep8-naming, W = pycodestyle warnings, UP = pyupgrade (modernise syntax),
# B = flake8-bugbear (common bugs), SIM = flake8-simplify.
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "SIM"]
# -- Dev dependency group ------------------------------------------------------
# These are installed only for development (`uv sync --group dev`).
# They are NOT shipped with the package.
[dependency-groups]
dev = [
"pytest>=8.0", # Test runner
"pytest-asyncio>=0.23", # Async test support (not used yet, but available)
"respx>=0.21", # Mock library for httpx requests
"ruff>=0.6", # Linter & formatter (single tool replaces black + isort + flake8)
"pytest-cov>=5.0", # Coverage reporting
"pdoc>=14.0", # API docs generation
]