"""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 does not, 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)