Files
typikon/pyproject.toml
T
funkpower 5d7e02cffb answer from Python too
The engine is the same; only the front door is new. pyo3 behind an optional
feature, maturin for the wheel, and the bindings mirror DayJson rather than Day
because DayJson is already the shape front ends read and the one that has to stay
still. to_dict() therefore gives exactly what --json gives, and a test holds the
two to that.

That test earned its place immediately. The bindings were calling
jurisdictions::resolve(None), which answers with a built-in default that knows
nothing about the machine, so Python was reckoning by the New Calendar while the
command line on the same box reckoned by ROCOR — every field downstream of the
calendar differed, including the fast. They now take the same two steps main.rs
takes, and agree field for field on Pascha, the Nativity and Theophany.

The wheel is abi3, so one build serves 3.9 upward rather than one per
interpreter. That costs the datetime C API, which the limited API does not
expose, so a date is read through its attributes instead — which incidentally
makes datetime.datetime work as well as datetime.date. Constructing dates is
unaffected, pyo3 calls Python's own constructor for that.

panic = "abort" comes out of the release profile. An extension module has to be
able to unwind a panic into a Python exception; aborting would take the
interpreter down with it. The CLI keeps the same behaviour it always had, a
panic there just unwinds now.

Mixed layout so the wheel can carry py.typed and a stub file, which a bare
extension module has nowhere to put. mypy --strict is clean against the stubs
and catches a deliberate error, so the Typing :: Typed classifier is not a claim
about nothing.
2026-09-18 11:28:08 -04:00

41 lines
1.4 KiB
TOML

[build-system]
requires = ["maturin>=1.9,<2.0"]
build-backend = "maturin"
[project]
name = "typikon"
description = "The Orthodox liturgical day: feasts, seasons and the fast, computed rather than fetched"
readme = "README.md"
license = "GPL-2.0-only"
license-files = ["LICENSE"]
requires-python = ">=3.9"
keywords = ["orthodox", "liturgical", "calendar", "byzantine", "pascha", "fasting"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Religion",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
# maturin takes it from Cargo.toml, so there is one place to bump.
dynamic = ["version"]
[project.urls]
Homepage = "https://git.pumpin.online/funkpower/typikon"
Repository = "https://git.pumpin.online/funkpower/typikon"
[tool.maturin]
bindings = "pyo3"
module-name = "typikon._typikon"
# Mixed layout: the compiled module is private and python/typikon wraps it, which
# is what lets the wheel carry py.typed and a stub file. A bare extension module
# has nowhere to put either.
python-source = "python"
# The crate also builds a CLI, and the pyo3 dependency is optional so that
# `cargo build` of it does not try to link against a Python that is not there.
# This is the only place the feature gets turned on.
features = ["python"]
strip = true