Skip to main content

diffcone

CI Docs PyPI Python License Ruff uv dependencies: none

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
      target:pytest:tests/test_calc.py::test_mul -[entry]-> tests.test_calc.test_mul -[references]-> calc.ops.mul
  pytest: tests/test_calc.py::test_square
    - dependency: calc.ops.mul body_changed
      target:pytest:tests/test_calc.py::test_square -[entry]-> tests.test_calc.test_square -[references]-> calc.ops.square -[references]-> calc.ops.mul

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.
  • pytest and ASV: tests and benchmarks are found from your configuration and source, the way each runner collects them.
  • Two ways to plan:
    • From the code (the default). diffcone reads your source and git history. It never imports your code or runs your tests.
    • From execution evidence (opt-in, Python 3.12+). For large codebases where nearly everything imports everything. You run your test suite once under diffcone's recorder, which notes what each test ran; plans then select from that recording. Recording runs your tests; planning from a recording only reads it.

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

# Run the suite once under the recorder, 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 more than 40 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.6.1

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.6.1
File Size Uploaded Provenance Actions
diffcone-0.6.1.tar.gz 625.8 kB With provenance Details for diffcone-0.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / diffcone-0.6.1.tar.gz

Download URL diffcone-0.6.1.tar.gz
Size 625.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b1edd2117eca09d75ba8bef6582fe8898809241b865e34153386f8339bf0b215
BLAKE2b-256 checksum
How to use checksums
2223a95326ef4537c754457078e4576b8f85dc128437d87f84c54a5ca309d389
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 22, 2026.

Transparency log

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

Download URL diffcone-0.6.1-py3-none-any.whl
Size 651.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e5221ae893f2e48932012cecd9dddd79c8008a4bb9c0d2f5989fa8539cbe485
BLAKE2b-256 checksum
How to use checksums
9bd25c25b872a4003efce4a3f3099b1e3e493f0253f25e7eccae8925f95d1365
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 22, 2026.

Transparency log

Security for diffcone 0.6.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for diffcone-0.6.1.tar.gz

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 Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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