-
-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathpyproject.toml
More file actions
295 lines (258 loc) · 9.3 KB
/
pyproject.toml
File metadata and controls
295 lines (258 loc) · 9.3 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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
[project]
name = "kerykeion"
version = "5.12.8"
authors = [
{ name = "Giacomo Battaglia", email = "kerykeion.astrology@gmail.com" }
]
description = "A Python library for astrological calculations, including natal charts, houses, planetary aspects, and SVG chart generation."
license = { text = "AGPL-3.0" }
readme = "README.md"
keywords = [
"astrology",
"astrology library",
"astrology calculations",
"astrology calculator",
"natal chart",
"birth chart",
"planetary aspects",
"astrology transits",
"houses of astrology",
"ephemeris",
"zodiac",
"zodiac signs",
"svg charts",
"synastry",
"astronomical algorithms"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Information Technology",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Religion",
"Typing :: Typed",
]
requires-python = ">=3.9"
dependencies = [
"pyswisseph>=2.10.3.2",
"pydantic>=2.5",
"scour>=0.38.2",
"requests-cache>=1.2.1",
"requests>=2.32.3",
"simple-ascii-tables>=1.0.0",
"pytz>=2024.2",
"typing-extensions>=4.12.2",
]
[project.urls]
Homepage = "https://www.kerykeion.net/"
Repository = "https://github.com/g-battaglia/kerykeion"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["kerykeion"]
[tool.hatch.build.targets.sdist]
include = [
"/kerykeion",
"/README.md",
"/LICENSE",
"/pyproject.toml",
"/MANIFEST.in",
]
# MyPy Static Analysis
[tool.mypy]
ignore_missing_imports = true
mypy_path = "kerykeion"
files = "kerykeion"
# PyTest Automated Testing
[tool.pytest.ini_options]
log_cli_level = 20
log_cli = true
testpaths = "tests"
log_level = 20
log_date_format = "%Y-%m-%d %H:%M:%S"
log_format = "%(asctime)s %(levelname)s %(message)s"
addopts = "-n 8"
markers = [
"online: tests requiring network access (GeoNames API)",
"core: hand-written essential tests with known values",
"base: DE440s tier (1849-2150)",
"medium: DE440 tier (1550-2650, cumulative)",
"extended: DE441 tier (full range, cumulative)",
]
# Coverage Configuration
[tool.coverage.run]
source = ["kerykeion"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/sweph/*", # Swiss Ephemeris library files
"setup.py",
"**/draw_planets_legacy.py", # Legacy code, not used
"kerykeion/charts/draw_planets_legacy.py", # Legacy code, not used
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
show_missing = true
skip_covered = false
precision = 2
[tool.coverage.html]
directory = "htmlcov"
# Task Runner
[tool.poe.tasks]
# Test — 4 levels, hierarchy: core < base < medium < extended
"test:core" = "pytest tests/core/ -m 'not online' --ignore=tests/core/test_houses_positions.py --ignore=tests/core/test_planetary_positions.py --ignore=tests/core/test_moon_phase_historical_verification.py --ignore=tests/core/test_subject_factory_parametrized.py --ignore=tests/core/test_chart_parametrized.py"
"test:base" = "pytest tests/ --tier=base -m 'not online'"
"test:medium" = "pytest tests/ --tier=medium -m 'not online'"
"test:extended" = "pytest tests/ -m 'not online'"
# Coverage — same tiers with coverage report (terminal + HTML in htmlcov/)
"test:core:cov" = "pytest tests/core/ -m 'not online' --ignore=tests/core/test_houses_positions.py --ignore=tests/core/test_planetary_positions.py --ignore=tests/core/test_moon_phase_historical_verification.py --ignore=tests/core/test_subject_factory_parametrized.py --ignore=tests/core/test_chart_parametrized.py --cov --cov-report=term-missing --cov-report=html"
"test:base:cov" = "pytest tests/ --tier=base -m 'not online' --cov --cov-report=term-missing --cov-report=html"
"test:medium:cov" = "pytest tests/ --tier=medium -m 'not online' --cov --cov-report=term-missing --cov-report=html"
"test:extended:cov" = "pytest tests/ -m 'not online' --cov --cov-report=term-missing --cov-report=html"
# Code Quality
lint = "ruff check"
format = "ruff format"
"format:all" = "ruff format kerykeion tests"
analyze = "mypy"
typecheck = "pyright"
[tool.poe.tasks.check]
sequence = ["lint", "analyze", "typecheck", "test:core"]
help = "Run all quality checks (lint, analyze, typecheck, test:core)"
[tool.poe.tasks.quality]
script = "scripts.quality_check:main"
help = "Run quality check script"
# Documentation
[tool.poe.tasks.docs]
cmd = "pdoc kerykeion -o ./docs"
help = "Generate API documentation"
[tool.poe.tasks."docs:check"]
cmd = "python scripts/check_documentation_coverage.py"
help = "Audit documentation coverage"
[tool.poe.tasks."docs:snippets"]
cmd = "python scripts/test_markdown_snippets.py"
help = "Test Python snippets in markdown files"
# Regenerate Golden Standards — one command per category
[tool.poe.tasks."regenerate:svg"]
sequence = ["regenerate:svg:base", "regenerate:svg:extended", "regenerate:svg:modern"]
help = "Regenerate all SVG chart baselines (tests/data/svg/)"
[tool.poe.tasks."regenerate:svg:base"]
cmd = "python scripts/regenerate_test_charts.py"
[tool.poe.tasks."regenerate:svg:extended"]
cmd = "python scripts/regenerate_test_charts_extended.py"
[tool.poe.tasks."regenerate:svg:modern"]
cmd = "python scripts/generate_modern_baselines.py"
[tool.poe.tasks."regenerate:reports"]
sequence = ["regenerate:reports:snapshots", "regenerate:reports:output"]
help = "Regenerate all report golden files (tests/fixtures/)"
[tool.poe.tasks."regenerate:reports:snapshots"]
cmd = "python scripts/regenerate_report_snapshots.py"
[tool.poe.tasks."regenerate:reports:output"]
cmd = "python scripts/regenerate_test_output.py"
[tool.poe.tasks."regenerate:positions"]
cmd = "python scripts/regenerate_all.py --positions --subjects"
help = "Regenerate expected positions and subjects (tests/data/expected_positions.py, expected_astrological_subjects.py)"
[tool.poe.tasks."regenerate:aspects"]
sequence = ["regenerate:aspects:natal", "regenerate:aspects:synastry", "regenerate:aspects:matrix"]
help = "Regenerate all expected aspects (tests/data/expected_*_aspects.py)"
[tool.poe.tasks."regenerate:aspects:natal"]
cmd = "python scripts/regenerate_expected_aspects.py"
[tool.poe.tasks."regenerate:aspects:synastry"]
cmd = "python scripts/regenerate_synastry_aspects.py"
[tool.poe.tasks."regenerate:aspects:matrix"]
cmd = "python scripts/regenerate_all.py --aspects"
[tool.poe.tasks."regenerate:all"]
sequence = ["regenerate:svg", "regenerate:reports", "regenerate:positions", "regenerate:aspects"]
help = "Regenerate all golden standards"
# Utilities
[tool.poe.tasks.clean]
cmd = "rm -rf dist build *.egg-info htmlcov .coverage .coverage.* coverage.xml .pytest_cache .mypy_cache .ruff_cache"
help = "Clean build artifacts and caches"
[tool.ruff]
line-length = 120
[tool.ruff.lint]
# Enable pyflakes (F) and pycodestyle (E, W) rules
select = [
"F", # Pyflakes - logic errors, undefined names, unused imports
"E", # pycodestyle errors
"W", # pycodestyle warnings
]
# Ignore rules that conflict with project structure
ignore = [
"E402", # Module level import not at top of file (needed for some modules)
"E501", # Line too long (handled by line-length setting)
"E731", # Do not assign a lambda expression, use a def (stylistic choice)
]
[tool.ruff.lint.per-file-ignores]
# Backward compatibility module uses import * intentionally
"kerykeion/backword.py" = ["F405", "F403", "F401"]
# Settings re-exports symbols intentionally
"kerykeion/settings/__init__.py" = ["F401", "F403"]
# Schemas re-exports for public API
"kerykeion/schemas/__init__.py" = ["F401", "F403"]
# Types re-exports for public API
"kerykeion/kr_types/__init__.py" = ["F405", "F403", "F401"]
# Pyright Static Type Checking
[tool.pyright]
include = ["kerykeion"]
exclude = [
"tests",
"examples",
"workspace",
"scripts",
"**/__pycache__",
".venv",
"dist",
"build",
"*.egg-info"
]
typeCheckingMode = "basic"
pythonVersion = "3.9"
pythonPlatform = "All"
venvPath = "."
venv = ".venv"
reportOptionalMemberAccess = "none"
reportIncompatibleVariableOverride = "none"
reportArgumentType = "none"
reportInvalidTypeForm = "error"
reportAttributeAccessIssue = "error"
reportGeneralTypeIssues = "none"
[dependency-groups]
dev = [
"coverage>=7.6.0",
"mypy>=1.17.1",
"pdoc>=15.0.4",
"poethepoet>=0.36.0",
"pyright>=1.1.408",
"pytest>=8.4.1",
"pytest-cov>=6.0.0",
"pytest-xdist>=3.5.0",
"ruff>=0.12.9",
"types-pytz>=2025.2.0.20250516",
"types-requests>=2.32.4.20250611",
]