Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
135 lines (110 loc) · 4.55 KB
/
Copy pathpyproject.toml
File metadata and controls
135 lines (110 loc) · 4.55 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
# ============================================================
# pyproject.toml (ALL-PY-SRC-REPOS)
# ============================================================
# Updated: 2026-09-29
# REQ: Python projects SHOULD include pyproject.toml as the single source of truth.
# WHY: Centralizes Python project configuration.
# ============================================================
# === SECTION 1: PROJECT IDENTITY ===
# ============================================================
[project]
name = "se-mapspec" # Package distribution name (lowercase and dashes).
description = "Structural Explainability Mapspec"
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.14"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.14",
"Typing :: Typed",
]
keywords = ["structural-explainability", "mapping"]
dependencies = []
[dependency-groups]
dev = ["prek", "pytest>=9", "pytest-cov", "ruff", "twine", "ty"]
# WHY: Documentation dependencies are isolated from runtime dependencies.
docs = ["mkdocstrings[python]", "zensical"]
[project.urls]
Documentation = "https://structural-explainability.github.io/se-mapspec/"
Homepage = "https://github.com/structural-explainability/se-mapspec"
Issues = "https://github.com/structural-explainability/se-mapspec/issues"
Source = "https://github.com/structural-explainability/se-mapspec"
[project.scripts]
se_mapspec = "se_mapspec.cli:main"
# ============================================================
# === SECTION 2: TOOL CONFIGURATION ===
# ============================================================
# === PYTEST (VERIFY LOGIC) ===
[tool.pytest.ini_options]
# WHY: Consistent test discovery and coverage visibility.
minversion = "9.0"
testpaths = ["tests"]
addopts = "--cov=src --cov-fail-under=75 --cov-report=term-missing"
# === RUFF (PYTHON FORMATTING AND LINTING) ===
[tool.ruff]
target-version = "py314"
[tool.ruff.lint]
# WHY: Evolve with Ruff's defaults; add rules only where the repository needs them.
extend-select = [
# "D", # Require docstrings when desired.
]
[tool.ruff.lint.isort]
# WHY: Sort plain-import and from-import lines together within each section.
force-sort-within-sections = true
[tool.ruff.lint.per-file-ignores]
"src/**/__init__.py" = ["F401"]
"src/**/_version.py" = ["ALL"]
"tests/**/*.py" = ["D", "B018"]
"notebooks/**/*.py" = ["D", "PLR1711", "RUF059"]
"src/**/notebook.py" = ["B018", "D", "PLR1711", "RUF059"]
[tool.ruff.lint.pydocstyle]
# WHY: Use Google docstring style when D rules are enabled.
convention = "google"
# === UV (PYTHON ENVIRONMENT AND DEPENDENCY MANAGEMENT) ===
[tool.uv]
# WHY: Install all dependency groups defined by this repository by default.
default-groups = "all"
# WHY: Allow time for newly published releases to receive ecosystem scrutiny.
# CUSTOM: Should match `uv run prek update --freeze --cooldown-days 7`.
exclude-newer = "7 days"
# ============================================================
# SECTION 3: BUILD SYSTEM (boilerplate; CUSTOM src/ agreement)
# ============================================================
#
# REQ.PROJECT: A build system MUST be declared for package discovery and publishing.
# REQ.STRUCTURE: All importable code MUST live under src/.
# WHY src/ layout: Prevents accidental imports from the repo root;
# ensures consistent behavior across IDEs, tests, CI, and PyPI.
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
[tool.hatch.build.hooks.vcs]
# WHY: Writes computed version into src/*/_version.py at build time.
# CUSTOM: Must match src/ folders.
version-file = "src/se_mapspec/_version.py"
[tool.hatch.build.targets.wheel]
# CUSTOM: Must match src/ folders.
packages = ["src/se_mapspec"] # REQ.PACKAGES: Discovery rooted at src/.
[tool.hatch.build.targets.wheel.force-include]
"alignment-schema.toml" = "se_mapspec/alignment-schema.toml"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/alignment-schema.toml",
"/LICENSE",
"/README.md",
"/pyproject.toml",
]
[tool.hatch.version]
# WHY: Version derived from git tags at build time — no manual source file edits.
source = "vcs"
fallback-version = "0.1.0" # Used when no git tags present (fresh clone, CI).
tag-pattern = "^(?:v)?(?P<version>\\d+\\.\\d+\\.\\d+)$"