Files
paperspec/pyproject.toml
T
alexmandClaude 4fb8b4f5a7 Add paperspec correct, check math forms and datasets, and give the tools public names
The work the other paper tools planned for paperspec (paperdesk PLAN M5.4,
paperform PLAN 4.2):

- paperspec correct and paperspec.revision apply proposed corrections to a
  package, folder or zip, and write it only once it validates.
- doc.math.form is checked: label and style commands always, the form's own
  spelling when papermath is installed or forms= is passed.
- paperspec.datasets and seven doc.dataset.* rules check a package's datasets.
- fixtures/invalid gains suspect-witness and math-form-label (33 in all).
- Canonical JSON reads numbers as doubles, so 1e20 round-trips.
- The registries and the JSON-LD context ship in the wheel.
- Public names for what paperdesk and paperform imported as private ones,
  with the old names kept as aliases.
- The text and lossy-projection functions are about three times faster
  through the gate, tested equal to the old code on every code point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013XwDhn4LkrKQfw4ArDEr2E
2026-10-20 22:10:17 -04:00

107 lines
4.3 KiB
TOML

# Package metadata only, and the build mapping setuptools needs. Tool settings live in their own files:
# pixi.toml (environments + tasks), .ruff.toml (lint/format), ty.toml (types), .pytest.ini (tests),
# .coveragerc (coverage).
# Deviation from the Scienting standard: setuptools with setuptools-scm instead of hatchling with hatch.toml.
# The package maps schemas/, sql/ and vectors/ from the repository root as data subpackages, and takes its
# version from git tags.
[build-system]
requires = ["setuptools>=80", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "paperspec"
dynamic = ["version"]
description = "The scienting formats: the reference implementation of every rule, with the JSON Schemas, SQL and test vectors as package data"
readme = "README.md"
# The code (src/) is Apache-2.0 and the schemas, SQL and vectors it carries are CC0-1.0, as LICENSE.md says.
license = "Apache-2.0 AND CC0-1.0"
license-files = ["LICENSE.md"]
authors = [{ name = "Scienting", email = "maintainer@scient.ing" }]
# Python 3.14 is the only version with the Unicode 16.0 character data the specification pins (spec/01 §1.4);
# 3.13 has 15.1 and 3.15 has 17.0, and the package refuses to import on either.
requires-python = ">=3.14,<3.15"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
]
# The base package is standard library only. `schema.py` needs jsonschema and
# `crypto.py` needs cryptography; the repository's own tools need both.
dependencies = []
[project.optional-dependencies]
schema = ["jsonschema>=4.26", "referencing>=0.35"]
crypto = ["cryptography>=46"]
tools = ["paperspec[crypto,schema]"]
# One command with subcommands: paperspec validate, load, check, build, stress and site; `paperspec --help`
# says which work anywhere and which need a checkout.
[project.scripts]
paperspec = "paperspec.cli.main:main"
[project.urls]
Homepage = "https://docs.scient.ing/paperspec/"
Documentation = "https://docs.scient.ing/paperspec/"
Specification = "https://paperspec.scient.ing"
Repository = "https://git.scient.ing/papers/paperspec"
Changelog = "https://git.scient.ing/papers/paperspec/src/branch/main/CHANGELOG.md"
# PEP 735 dependency groups (pip >= 25.1: `pip install -e ".[tools]" --group dev`).
# pixi.toml mirrors these for conda-forge environments. The tests need the `tools` extra as well.
[dependency-groups]
test = ["pytest>=8.4", "pytest-cov>=6", "hypothesis>=6.130"]
lint = ["ruff>=0.17.1,<0.18", "ty>=0.0.89,<0.0.90"]
dev = [
{ include-group = "test" },
{ include-group = "lint" },
"pre-commit>=4",
"build>=1.2",
"twine>=6.1",
]
# The code is `src/paperspec`. The schemas, SQL, vectors, registries and JSON-LD context stay at the
# repository root, where the specification links to them and the website serves the schemas at their `$id`
# URLs, and travel with the package as data subpackages, so a consumer reads them with importlib.resources.
# That mapping is why the packages are listed rather than found.
[tool.setuptools]
packages = [
"paperspec",
"paperspec.cli",
"paperspec.schemas",
"paperspec.sql",
"paperspec.vectors",
"paperspec.registry",
"paperspec.registry.stamps",
"paperspec.registry.stages",
"paperspec.context",
]
[tool.setuptools.package-dir]
"" = "src"
"paperspec.schemas" = "schemas"
"paperspec.sql" = "sql"
"paperspec.vectors" = "vectors"
"paperspec.registry" = "registry"
"paperspec.context" = "context"
[tool.setuptools.package-data]
"paperspec.schemas" = ["*.json"]
"paperspec.sql" = ["*.sql"]
"paperspec.vectors" = ["*.jsonl"]
"paperspec.registry" = ["*.json"]
"paperspec.registry.stamps" = ["*.json"]
"paperspec.registry.stages" = ["*.json"]
"paperspec.context" = ["*.jsonld"]
# The package version comes from git tags (v0.1.1 builds as 0.1.1, later commits as 0.1.2.devN); CONTRIBUTING.md
# says how it relates to the format version that CHANGELOG.md and pixi.toml carry. A source tree without git
# history, such as a downloaded archive, builds as 0+unknown instead of failing.
[tool.setuptools_scm]
fallback_version = "0+unknown"
version_file = "src/paperspec/_version.py"
version_scheme = "guess-next-dev"
local_scheme = "node-and-timestamp"