Files
paperspec/tools/__init__.py
T
alexmandClaude cfe1f39099 feat!: require Python 3.14 for the paperspec package
The specification pins the Unicode 16.0 character data (spec/01 §1.4),
which Python 3.14 is the first to ship; Python 3.12 has 15.0 and 3.13 has
15.1, so text with characters added in 16.0 could normalize differently
there. The tools already required 3.14; the package now does too.

- pyproject.toml: requires-python >= 3.14, with the 3.14 classifier.
- The package and tools docstrings, tools/README.md and the changelog say
  3.14 instead of 3.12.

pixi.lock still needs `pixi lock` (see the previous commit); its paperspec
entry also records the old requires-python.

pixi run check passes; no computed value changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:05:26 -04:00

25 lines
1.1 KiB
Python

"""The repository's own programs; see tools/README.md.
Importing this package checks that the tools can run here, and puts `src/` first on the path, so that
`import paperspec` gets this checkout's reference implementation rather than an installed copy.
The tools need Python 3.14 and the packages `cryptography` and `jsonschema`; the `paperspec` package
itself needs Python 3.14 but neither package, and other programs install it on its own.
"""
import importlib.util
import os
import sys
if sys.version_info < (3, 14):
sys.exit("The paperspec tools need Python 3.14 or later; this is Python %d.%d." % sys.version_info[:2])
_missing = [m for m in ("cryptography", "jsonschema") if importlib.util.find_spec(m) is None]
if _missing:
sys.exit("The paperspec tools need %s %s; run them through pixi, or install %s with pip."
% ("the package" if len(_missing) == 1 else "the packages", " and ".join(_missing),
"it" if len(_missing) == 1 else "them"))
SRC = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "src")
if SRC not in sys.path:
sys.path.insert(0, SRC)