Skip to main content

diffcone

CI Docs

Run the tests your change can affect, and know why each one was picked.

diffcone compares two versions of a Python repository, finds the functions, methods and classes that changed, and follows the code's dependencies back to the tests and benchmarks that can observe them. Each selected test comes with the reason it was selected.

$ diffcone plan --base main --head WORKTREE --discover pytest \
    --source-root src --source-root . --format text
...
changed symbols (1):
  calc.ops.mul [function] body_changed

selected targets (2):
  pytest: tests/test_calc.py::test_mul
    - dependency: calc.ops.mul body_changed
  pytest: tests/test_calc.py::test_square
    - dependency: calc.ops.mul body_changed

unselected targets (1):
  pytest: tests/test_calc.py::test_add
  • Every selection is explained: the report shows the chain of calls and references from each test to the change.
  • It errs on the side of running more: when diffcone can't tell what a change reaches, it selects more tests and says why.
  • It never runs your code to plan: planning reads files and git history only.
  • pytest and ASV: tests and benchmarks are found from your configuration and source, the way each runner collects them.
  • Execution evidence: for large codebases where nearly everything imports everything, record once what each test ran and plan from that.

Install

Python 3.11 or later and git; no other dependencies.

uv tool install diffcone    # or: pipx install diffcone, pip install diffcone

Use

# Which tests can my uncommitted changes affect?
diffcone plan --base main --head WORKTREE --discover pytest --format text

# Run only those tests (arguments after -- go to pytest)
diffcone run --base main --head WORKTREE --discover pytest --command "uv run pytest" -- -x

# Record what each test runs, then plan from the recording (Python 3.12+)
diffcone collect --command "uv run pytest" -- -n 8
diffcone plan --base main --head HEAD --discover pytest --evidence auto -o plan.json

# Did the plan select every test that failed in a full run?
diffcone check --plan plan.json --full full.xml

For a src layout, add --source-root src --source-root . so modules get their import names.

Documentation

Read the documentation at bearing-research.github.io/diffcone:

Status

diffcone is alpha software. Its selections have been checked against the full test suites of 34 open-source projects. See the changelog for what each release contains.

Contributing

uv sync
uv run pytest
uv run ruff check src tests scripts && uv run ruff format --check src tests scripts
uv run ty check

See the development guide and AGENTS.md.

License

MIT; see LICENSE.

Metadata

Release files for diffcone 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diffcone 0.2.0
File Size Uploaded
diffcone-0.2.0.tar.gz 220.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for diffcone 0.2.0
File Interpreter ABI Platform
diffcone-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 460.9 kB

Release files / diffcone-0.2.0.tar.gz

Download URL diffcone-0.2.0.tar.gz
Size 220.1 kB
Tags Source
SHA-256 checksum
How to use checksums
534dc33219b14ba224683a8d3348185ea970d4a82b1e8d094990abf4708612f3
BLAKE2b-256 checksum
How to use checksums
1de93e9b9f5e9101cf4f8a8397f436d3cab9972120a6b05d66cada51881cdb89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / diffcone-0.2.0-py3-none-any.whl

Download URL diffcone-0.2.0-py3-none-any.whl
Size 240.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cdd59079c439b17ce45dfe9d1137f06e7c2d9994737b178bef920352a7c4a1b
BLAKE2b-256 checksum
How to use checksums
da63794dab6545b1c171f3733c830adf1548af4f3e3b0f9a29a9e6d3945965c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page