---
url: /dev/development/contributing.md
description: >-
  Set up scikit-link for development, choose checks for your change, and preview
  the documentation locally.
---

# Contributing

**Clone the repository and run `uv sync --all-extras` to set up a development
environment. Then run the checks that cover your change.** The project rules
for every contribution are in
[AGENTS.md](https://github.com/rodrigo-arenas/scikit-link/blob/main/AGENTS.md).

## Development setup

Install Git and [uv](https://docs.astral.sh/uv/). uv can install the Python
version the project needs. Install Node.js 22 or later if you will build or
preview the documentation site.

```bash
git clone https://github.com/rodrigo-arenas/scikit-link
cd scikit-link
uv sync --all-extras
uv run pre-commit install
```

`uv sync --all-extras` creates `.venv` with the package in editable mode, the
development tools, and the optional table libraries. uv uses the versions
recorded in `uv.lock`. Use `uv run` to run commands in that environment on
Windows, macOS, or Linux.

## Checks

[nox](https://nox.thea.codes/) runs the same sessions locally and in CI. For
a first change, run the relevant tests and use the table to find any additional
session you need.

| Command | What it does |
|---|---|
| `uv run nox` | Lint, type checking and tests on every supported Python |
| `uv run nox -s lint` | Ruff, spelling, workflow audit and the unit-test justification guard |
| `uv run nox -s types` | mypy in strict mode |
| `uv run nox -s tests-3.12` | Test suite on one Python version, with all optional dependencies |
| `uv run nox -s tests_no_extras` | Test suite with only the required dependencies |
| `uv run nox -s tests_min` | Test suite against the lowest dependency versions allowed, optional ones included |
| `uv run nox -s tests_free_threaded` | Test suite on free-threaded Python 3.14t, informative in CI (the first run builds duckdb from source, about 40 minutes) |
| `uv run nox -s tests_nightly` | Contract suite against the development version of scikit-learn (run weekly in CI) |
| `uv run nox -s tests_ecosystem` | Interoperability tests with the latest skops, skrub and SHAP, which are not in the lock file (run weekly in CI) |
| `uv run nox -s build` | Build the sdist and wheel, validate them and smoke-test the wheel |
| `uv run nox -s docs` | Generate the API reference and build the site |
| `uv run nox -s docs_examples` | Run the examples of the README and the docs and compare what they print with the page (`-- --update` rewrites the output blocks) |

While iterating, point pytest to the affected test file. For example, these
commands check the package version and run Ruff:

```bash
uv run pytest tests/e2e/test_package.py -k version
uv run ruff check src tests
uv run ruff format --check src tests
```

## Tests

Tests go through the public API and live in `tests/contract`, `tests/e2e` and
`tests/integration`. Prefer extending an existing integration or end-to-end test
over adding a new one.

Unit tests are the exception. One is accepted only when its docstring starts with
`Justification (<code>): <reason>`, using one of these codes: `numeric-kernel`,
`persistent-format`, `error-message`, `regression` or `cost`. The lint session
rejects tests under `tests/unit` without it. The reasoning behind each code is in
the testing policy of `AGENTS.md`.

## Changelog

Changes that users can notice add a fragment to `changelog.d/`, named
`<issue-or-PR-number>.<type>.md`, or `+<short-slug>.<type>.md` when there is no
issue, with one of the types `feature`, `bugfix`, `removal`, `doc` or `misc`.
[changelog.d/README.md](https://github.com/rodrigo-arenas/scikit-link/blob/main/changelog.d/README.md) shows how to write one. CI checks
that a pull request adds one; maintainers can waive it with the `no-changelog`
label.

## Documentation

The site uses [VitePress](https://vitepress.dev/). The page you want to edit
determines where to start.

* `docs/site/` is the landing page and the blog, published at the root of the site.
* `docs/content/` is the documentation. It is built once per version and
  published under `/dev/`, `/stable/` and `/X.Y/`.
* `docs/content/api/` is generated by `docs/scripts/build_api.py`. To change
  an API page, update the [NumPy-style](https://numpydoc.readthedocs.io/en/latest/format.html)
  docstring and run the generator.

Install the Node dependencies with `npm ci`, then start the preview that
matches the page you edited.

```bash
uv run python docs/scripts/build_api.py
npm --prefix docs ci
npm --prefix docs run docs:dev          # live preview of the documentation
npm --prefix docs run docs:dev root     # live preview of the landing page and blog
npm --prefix docs run docs:build:all    # build both, laid out as published
npm --prefix docs run docs:preview      # serve that build
```

Python examples on a page run in order with a shared set of variables. When
you edit an example, check it by passing its page to `docs_examples`:

```bash
uv run nox -s docs_examples -- docs/content/getting-started/quickstart.md
```

If the example is meant to print something new, run the same command with
`--update` after the page path. Review the generated change in the `text`
block marked with `<!-- output -->` or titled `[output]` in a code group.
Put `<!-- skip -->` immediately above a block that requires something the
checker cannot provide, such as a separate Featuretools environment.

## Releases

Maintainers release by publishing a GitHub release with a `vX.Y.Z` tag. The
package version comes from the tag. The release workflow builds the
distribution, publishes it to TestPyPI and then to PyPI through trusted
publishing.

Only after the package is on PyPI, the release workflow freezes the
documentation:

1. The documentation of the tag is built once and published at `/X.Y/`. It is
   never rebuilt, so it keeps describing the code that was released. A patch
   release (`vX.Y.1`) replaces `/X.Y/`.
2. If `X.Y` is the newest released minor version, the same build is also
   published at `/stable/`, the only documentation indexed by search engines.
   A patch to an older line (`v0.1.3` after `v0.2.0`) does not touch `/stable/`.
3. The docs workflow then runs on `main`, which rebuilds the landing site and
   `/dev/` and updates `versions.json`.

Readers pick a version with the selector in the navigation bar. It reads
`versions.json` when the page loads, so frozen versions also list releases
published after them, and it keeps the current page when it exists in the
target version. Older versions and `/dev/` show a banner linking to the stable
documentation. Pre-releases (`a`, `b`, `rc`) do not get a documentation
version. To rebuild a frozen version by hand, run the Docs workflow with its
tag as input.

Before tagging, assemble the release notes and commit the result:

```bash
uv run towncrier build --version X.Y.Z
```
