Files
paperspec/docs/package/start/install.md
T
alexmandClaude 30d310f64d Publish the package and its documentation, and move to the papers organization
Add the Zensical documentation of the Python package (docs/package, built by the docs
workflow), merge the standard publish workflow with the setuptools-scm tag check, add the
SPDX header rule to ruff, restructure the README, and point every repository and registry
address at the Gitea organization papers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8cL4zN4XpaQF5cBtASzfq
2026-10-19 04:23:49 -04:00

75 lines
3.1 KiB
Markdown

# Install
The package needs Python 3.14.
Its base install has no dependencies: every module imports with the standard library alone.
Three extras add what some modules need:
| Extra | Adds | Needed by |
| --- | --- | --- |
| `schema` | `jsonschema`, `referencing` | schema validation, so `package.validate` and `corrections.gate` |
| `crypto` | `cryptography` | Ed25519 signatures and HKDF in `crypto`, which the signature and receipt checks use |
| `tools` | both of the above | the `paperspec` command, and any program that validates packages |
## From the studio's package registry
The registry does not mirror PyPI, so an installer needs two indexes: the registry for `paperspec`, and PyPI for `jsonschema`, `referencing` and `cryptography`.
Tie `paperspec` to the registry wherever the installer allows it, so that a package of the same name on PyPI is never chosen instead.
`[CHECK: no version tag has been pushed yet, so the registry holds no release until the first tag is published]`
With pixi, in `pixi.toml`:
```toml
[pypi-dependencies]
paperspec = { version = ">=0.1.1", extras = ["tools"], index = "https://git.scient.ing/api/packages/papers/pypi/simple" }
```
With uv, in `pyproject.toml`:
```toml
[[tool.uv.index]]
name = "scienting"
url = "https://git.scient.ing/api/packages/papers/pypi/simple"
explicit = true
[tool.uv.sources]
paperspec = { index = "scienting" }
```
With pip, which cannot tie a package to an index and takes the highest version from either:
```sh
pip install --index-url https://git.scient.ing/api/packages/papers/pypi/simple/ --extra-index-url https://pypi.org/simple/ "paperspec[tools]"
```
If the organization or the package is private, the installer also needs a token with the `read:package` scope, for example in a `~/.netrc` entry for `git.scient.ing`.
## From a checkout
Clone the repository and let pixi set up a pinned environment, with the package installed editable:
```sh
git clone https://git.scient.ing/papers/paperspec
pixi install
pixi run check
```
`pixi run check` runs the formatter, the linter, the type checker, the Markdown lint, the tests and the repository's own checker, and ends with `All checks pass.`
Without pixi, install the checkout with `pip install -e ".[tools]" --group dev` on Python 3.14.
## The pixi tasks
| Task | Does |
| --- | --- |
| `check` | Every check CI runs, in order: `fmt-check`, `lint`, `typecheck`, `lint-md`, `test`, `verify`. |
| `verify` | `paperspec check`, the repository's own checker. |
| `quick` | `paperspec check --quick`, which skips the byte-for-byte rebuild. |
| `fmt`, `fmt-check` | Format the code with ruff, or check the formatting. |
| `lint`, `lint-fix` | Lint with ruff, or lint and apply the safe fixes. |
| `typecheck` | Type-check `src/` with ty. |
| `test`, `cov` | Run the pytest suite, or run it with branch coverage that fails under 90%. |
| `lint-md` | Lint every Markdown file with markdownlint. |
| `build`, `load`, `validate`, `stress`, `site` | The commands of the same names. |
| `hooks` | Install the git pre-commit hooks. |
| `docs-build`, `docs-serve` | Build these pages strictly into `build/docs`, or preview them. |
| `dist` | Build the sdist and wheel into `dist/`. |