diffcone 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. diffcone-0.1.0/LICENSE +21 -0
  2. diffcone-0.1.0/PKG-INFO +133 -0
  3. diffcone-0.1.0/README.md +104 -0
  4. diffcone-0.1.0/pyproject.toml +90 -0
  5. diffcone-0.1.0/pyproject.toml.orig +73 -0
  6. diffcone-0.1.0/src/diffcone/__init__.py +13 -0
  7. diffcone-0.1.0/src/diffcone/cache.py +528 -0
  8. diffcone-0.1.0/src/diffcone/check.py +399 -0
  9. diffcone-0.1.0/src/diffcone/classify.py +255 -0
  10. diffcone-0.1.0/src/diffcone/cli.py +886 -0
  11. diffcone-0.1.0/src/diffcone/collect.py +846 -0
  12. diffcone-0.1.0/src/diffcone/cython.py +757 -0
  13. diffcone-0.1.0/src/diffcone/declarations.py +111 -0
  14. diffcone-0.1.0/src/diffcone/discovery/__init__.py +121 -0
  15. diffcone-0.1.0/src/diffcone/discovery/asv_static.py +494 -0
  16. diffcone-0.1.0/src/diffcone/discovery/common.py +130 -0
  17. diffcone-0.1.0/src/diffcone/discovery/pytest_static.py +2680 -0
  18. diffcone-0.1.0/src/diffcone/evidence.py +738 -0
  19. diffcone-0.1.0/src/diffcone/evidence_plan.py +1487 -0
  20. diffcone-0.1.0/src/diffcone/execution.py +1681 -0
  21. diffcone-0.1.0/src/diffcone/indexer/__init__.py +48 -0
  22. diffcone-0.1.0/src/diffcone/indexer/core.py +286 -0
  23. diffcone-0.1.0/src/diffcone/indexer/definitions.py +292 -0
  24. diffcone-0.1.0/src/diffcone/indexer/dynamics.py +406 -0
  25. diffcone-0.1.0/src/diffcone/indexer/facts.py +373 -0
  26. diffcone-0.1.0/src/diffcone/indexer/literals.py +388 -0
  27. diffcone-0.1.0/src/diffcone/indexer/references.py +895 -0
  28. diffcone-0.1.0/src/diffcone/indexer/resolver.py +1001 -0
  29. diffcone-0.1.0/src/diffcone/indexer/scopes.py +276 -0
  30. diffcone-0.1.0/src/diffcone/indexer/state.py +83 -0
  31. diffcone-0.1.0/src/diffcone/indexer/symbols.py +441 -0
  32. diffcone-0.1.0/src/diffcone/indexer/syntax.py +173 -0
  33. diffcone-0.1.0/src/diffcone/manifest.py +166 -0
  34. diffcone-0.1.0/src/diffcone/model.py +191 -0
  35. diffcone-0.1.0/src/diffcone/planner.py +1453 -0
  36. diffcone-0.1.0/src/diffcone/report.py +256 -0
  37. diffcone-0.1.0/src/diffcone/selection.py +133 -0
  38. diffcone-0.1.0/src/diffcone/snapshot.py +739 -0
  39. diffcone-0.1.0/src/diffcone/testing.py +200 -0
diffcone-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bearing Research
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,133 @@
1
+ Metadata-Version: 2.4
2
+ Name: diffcone
3
+ Version: 0.1.0
4
+ Summary: Static-first, function-level change-impact engine for Python: which tests and benchmarks a change can affect, and why
5
+ Keywords: test selection,test impact analysis,change impact,pytest,asv,ci
6
+ Author: Bearing Research
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Framework :: Pytest
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Classifier: Topic :: Software Development :: Testing
22
+ Requires-Python: >=3.11
23
+ Project-URL: Homepage, https://github.com/bearing-research/diffcone
24
+ Project-URL: Documentation, https://bearing-research.github.io/diffcone/
25
+ Project-URL: Repository, https://github.com/bearing-research/diffcone
26
+ Project-URL: Issues, https://github.com/bearing-research/diffcone/issues
27
+ Project-URL: Changelog, https://github.com/bearing-research/diffcone/blob/main/CHANGELOG.md
28
+ Description-Content-Type: text/markdown
29
+
30
+ # diffcone
31
+
32
+ [![CI](https://github.com/bearing-research/diffcone/actions/workflows/ci.yml/badge.svg)](https://github.com/bearing-research/diffcone/actions/workflows/ci.yml)
33
+ [![Docs](https://github.com/bearing-research/diffcone/actions/workflows/docs.yml/badge.svg)](https://bearing-research.github.io/diffcone/)
34
+
35
+ **Run the tests your change can affect, and know why each one was picked.**
36
+
37
+ diffcone compares two versions of a Python repository, finds the functions,
38
+ methods and classes that changed, and follows the code's dependencies back
39
+ to the tests and benchmarks that can observe them. Each selected test comes
40
+ with the reason it was selected.
41
+
42
+ ```console
43
+ $ diffcone plan --base main --head WORKTREE --discover pytest \
44
+ --source-root src --source-root . --format text
45
+ ...
46
+ changed symbols (1):
47
+ calc.ops.mul [function] body_changed
48
+
49
+ selected targets (2):
50
+ pytest: tests/test_calc.py::test_mul
51
+ - dependency: calc.ops.mul body_changed
52
+ pytest: tests/test_calc.py::test_square
53
+ - dependency: calc.ops.mul body_changed
54
+
55
+ unselected targets (1):
56
+ pytest: tests/test_calc.py::test_add
57
+ ```
58
+
59
+ - **Every selection is explained:** the report shows the chain of calls and
60
+ references from each test to the change.
61
+ - **It errs on the side of running more:** when diffcone can't tell what a
62
+ change reaches, it selects more tests and says why.
63
+ - **It never runs your code to plan:** planning reads files and git history
64
+ only.
65
+ - **pytest and ASV:** tests and benchmarks are found from your
66
+ configuration and source, the way each runner collects them.
67
+ - **Execution evidence:** for large codebases where nearly everything
68
+ imports everything, record once what each test ran and plan from that.
69
+
70
+ ## Install
71
+
72
+ Python 3.11 or later and git; no other dependencies.
73
+
74
+ ```bash
75
+ uv tool install diffcone # or: pipx install diffcone, pip install diffcone
76
+ ```
77
+
78
+ ## Use
79
+
80
+ ```bash
81
+ # Which tests can my uncommitted changes affect?
82
+ diffcone plan --base main --head WORKTREE --discover pytest --format text
83
+
84
+ # Run only those tests (arguments after -- go to pytest)
85
+ diffcone run --base main --head WORKTREE --discover pytest --command "uv run pytest" -- -x
86
+
87
+ # Record what each test runs, then plan from the recording (Python 3.12+)
88
+ diffcone collect --command "uv run pytest" -- -n 8
89
+ diffcone plan --base main --head HEAD --discover pytest --evidence auto -o plan.json
90
+
91
+ # Did the plan select every test that failed in a full run?
92
+ diffcone check --plan plan.json --full full.xml
93
+ ```
94
+
95
+ For a `src` layout, add `--source-root src --source-root .` so modules get
96
+ their import names.
97
+
98
+ ## Documentation
99
+
100
+ Read the documentation at
101
+ **[bearing-research.github.io/diffcone](https://bearing-research.github.io/diffcone/)**:
102
+
103
+ - [Getting started](https://bearing-research.github.io/diffcone/latest/getting-started/)
104
+ - [How it works](https://bearing-research.github.io/diffcone/latest/concepts/)
105
+ - Guides: [planning](https://bearing-research.github.io/diffcone/latest/guides/planning/),
106
+ [running and checking](https://bearing-research.github.io/diffcone/latest/guides/running/),
107
+ [execution evidence](https://bearing-research.github.io/diffcone/latest/guides/evidence/),
108
+ [CI with GitHub Actions](https://bearing-research.github.io/diffcone/latest/ci/)
109
+ - [Command reference](https://bearing-research.github.io/diffcone/latest/reference/cli/)
110
+ and [limitations](https://bearing-research.github.io/diffcone/latest/limitations/)
111
+
112
+ ## Status
113
+
114
+ diffcone is alpha software. Its selections have been checked against the
115
+ full test suites of 34 open-source projects. See the
116
+ [changelog](https://github.com/bearing-research/diffcone/blob/main/CHANGELOG.md)
117
+ for what each release contains.
118
+
119
+ ## Contributing
120
+
121
+ ```bash
122
+ uv sync
123
+ uv run pytest
124
+ uv run ruff check src tests scripts && uv run ruff format --check src tests scripts
125
+ uv run ty check
126
+ ```
127
+
128
+ See the [development guide](https://bearing-research.github.io/diffcone/latest/development/)
129
+ and [AGENTS.md](https://github.com/bearing-research/diffcone/blob/main/AGENTS.md).
130
+
131
+ ## License
132
+
133
+ MIT; see [LICENSE](https://github.com/bearing-research/diffcone/blob/main/LICENSE).
@@ -0,0 +1,104 @@
1
+ # diffcone
2
+
3
+ [![CI](https://github.com/bearing-research/diffcone/actions/workflows/ci.yml/badge.svg)](https://github.com/bearing-research/diffcone/actions/workflows/ci.yml)
4
+ [![Docs](https://github.com/bearing-research/diffcone/actions/workflows/docs.yml/badge.svg)](https://bearing-research.github.io/diffcone/)
5
+
6
+ **Run the tests your change can affect, and know why each one was picked.**
7
+
8
+ diffcone compares two versions of a Python repository, finds the functions,
9
+ methods and classes that changed, and follows the code's dependencies back
10
+ to the tests and benchmarks that can observe them. Each selected test comes
11
+ with the reason it was selected.
12
+
13
+ ```console
14
+ $ diffcone plan --base main --head WORKTREE --discover pytest \
15
+ --source-root src --source-root . --format text
16
+ ...
17
+ changed symbols (1):
18
+ calc.ops.mul [function] body_changed
19
+
20
+ selected targets (2):
21
+ pytest: tests/test_calc.py::test_mul
22
+ - dependency: calc.ops.mul body_changed
23
+ pytest: tests/test_calc.py::test_square
24
+ - dependency: calc.ops.mul body_changed
25
+
26
+ unselected targets (1):
27
+ pytest: tests/test_calc.py::test_add
28
+ ```
29
+
30
+ - **Every selection is explained:** the report shows the chain of calls and
31
+ references from each test to the change.
32
+ - **It errs on the side of running more:** when diffcone can't tell what a
33
+ change reaches, it selects more tests and says why.
34
+ - **It never runs your code to plan:** planning reads files and git history
35
+ only.
36
+ - **pytest and ASV:** tests and benchmarks are found from your
37
+ configuration and source, the way each runner collects them.
38
+ - **Execution evidence:** for large codebases where nearly everything
39
+ imports everything, record once what each test ran and plan from that.
40
+
41
+ ## Install
42
+
43
+ Python 3.11 or later and git; no other dependencies.
44
+
45
+ ```bash
46
+ uv tool install diffcone # or: pipx install diffcone, pip install diffcone
47
+ ```
48
+
49
+ ## Use
50
+
51
+ ```bash
52
+ # Which tests can my uncommitted changes affect?
53
+ diffcone plan --base main --head WORKTREE --discover pytest --format text
54
+
55
+ # Run only those tests (arguments after -- go to pytest)
56
+ diffcone run --base main --head WORKTREE --discover pytest --command "uv run pytest" -- -x
57
+
58
+ # Record what each test runs, then plan from the recording (Python 3.12+)
59
+ diffcone collect --command "uv run pytest" -- -n 8
60
+ diffcone plan --base main --head HEAD --discover pytest --evidence auto -o plan.json
61
+
62
+ # Did the plan select every test that failed in a full run?
63
+ diffcone check --plan plan.json --full full.xml
64
+ ```
65
+
66
+ For a `src` layout, add `--source-root src --source-root .` so modules get
67
+ their import names.
68
+
69
+ ## Documentation
70
+
71
+ Read the documentation at
72
+ **[bearing-research.github.io/diffcone](https://bearing-research.github.io/diffcone/)**:
73
+
74
+ - [Getting started](https://bearing-research.github.io/diffcone/latest/getting-started/)
75
+ - [How it works](https://bearing-research.github.io/diffcone/latest/concepts/)
76
+ - Guides: [planning](https://bearing-research.github.io/diffcone/latest/guides/planning/),
77
+ [running and checking](https://bearing-research.github.io/diffcone/latest/guides/running/),
78
+ [execution evidence](https://bearing-research.github.io/diffcone/latest/guides/evidence/),
79
+ [CI with GitHub Actions](https://bearing-research.github.io/diffcone/latest/ci/)
80
+ - [Command reference](https://bearing-research.github.io/diffcone/latest/reference/cli/)
81
+ and [limitations](https://bearing-research.github.io/diffcone/latest/limitations/)
82
+
83
+ ## Status
84
+
85
+ diffcone is alpha software. Its selections have been checked against the
86
+ full test suites of 34 open-source projects. See the
87
+ [changelog](https://github.com/bearing-research/diffcone/blob/main/CHANGELOG.md)
88
+ for what each release contains.
89
+
90
+ ## Contributing
91
+
92
+ ```bash
93
+ uv sync
94
+ uv run pytest
95
+ uv run ruff check src tests scripts && uv run ruff format --check src tests scripts
96
+ uv run ty check
97
+ ```
98
+
99
+ See the [development guide](https://bearing-research.github.io/diffcone/latest/development/)
100
+ and [AGENTS.md](https://github.com/bearing-research/diffcone/blob/main/AGENTS.md).
101
+
102
+ ## License
103
+
104
+ MIT; see [LICENSE](https://github.com/bearing-research/diffcone/blob/main/LICENSE).
@@ -0,0 +1,90 @@
1
+ [project]
2
+ name = "diffcone"
3
+ version = "0.1.0"
4
+ description = "Static-first, function-level change-impact engine for Python: which tests and benchmarks a change can affect, and why"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.11"
9
+ dependencies = []
10
+ keywords = [
11
+ "test selection",
12
+ "test impact analysis",
13
+ "change impact",
14
+ "pytest",
15
+ "asv",
16
+ "ci",
17
+ ]
18
+ classifiers = [
19
+ "Development Status :: 3 - Alpha",
20
+ "Environment :: Console",
21
+ "Framework :: Pytest",
22
+ "Intended Audience :: Developers",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3 :: Only",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
30
+ "Topic :: Software Development :: Quality Assurance",
31
+ "Topic :: Software Development :: Testing",
32
+ ]
33
+
34
+ [[project.authors]]
35
+ name = "Bearing Research"
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/bearing-research/diffcone"
39
+ Documentation = "https://bearing-research.github.io/diffcone/"
40
+ Repository = "https://github.com/bearing-research/diffcone"
41
+ Issues = "https://github.com/bearing-research/diffcone/issues"
42
+ Changelog = "https://github.com/bearing-research/diffcone/blob/main/CHANGELOG.md"
43
+
44
+ [project.scripts]
45
+ diffcone = "diffcone.cli:main"
46
+
47
+ [build-system]
48
+ requires = ["uv_build>=0.8,<1"]
49
+ build-backend = "uv_build"
50
+
51
+ [dependency-groups]
52
+ dev = [
53
+ "cython>=3.1",
54
+ "pytest>=8",
55
+ "pytest-cov>=5",
56
+ "ruff>=0.5",
57
+ "setuptools",
58
+ "ty==0.0.84",
59
+ ]
60
+ docs = [
61
+ "zensical==0.0.68",
62
+ "mike @ git+https://github.com/squidfunk/mike.git@2.2.0+zensical-0.1.0",
63
+ ]
64
+
65
+ [tool.ruff]
66
+ line-length = 100
67
+ target-version = "py311"
68
+
69
+ [tool.ruff.lint]
70
+ select = [
71
+ "E",
72
+ "F",
73
+ "I",
74
+ "UP",
75
+ "B",
76
+ ]
77
+
78
+ [tool.ty.environment]
79
+ python-version = "3.11"
80
+
81
+ [tool.ty.src]
82
+ include = [
83
+ "src",
84
+ "tests",
85
+ "scripts",
86
+ ]
87
+ exclude = ["scripts/evidence_spike"]
88
+
89
+ [tool.pytest.ini_options]
90
+ testpaths = ["tests"]
@@ -0,0 +1,73 @@
1
+ [project]
2
+ name = "diffcone"
3
+ version = "0.1.0"
4
+ description = "Static-first, function-level change-impact engine for Python: which tests and benchmarks a change can affect, and why"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ authors = [{ name = "Bearing Research" }]
9
+ requires-python = ">=3.11"
10
+ dependencies = []
11
+ keywords = ["test selection", "test impact analysis", "change impact", "pytest", "asv", "ci"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Environment :: Console",
15
+ "Framework :: Pytest",
16
+ "Intended Audience :: Developers",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Topic :: Software Development :: Quality Assurance",
25
+ "Topic :: Software Development :: Testing",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/bearing-research/diffcone"
30
+ Documentation = "https://bearing-research.github.io/diffcone/"
31
+ Repository = "https://github.com/bearing-research/diffcone"
32
+ Issues = "https://github.com/bearing-research/diffcone/issues"
33
+ Changelog = "https://github.com/bearing-research/diffcone/blob/main/CHANGELOG.md"
34
+
35
+ [project.scripts]
36
+ diffcone = "diffcone.cli:main"
37
+
38
+ [build-system]
39
+ requires = ["uv_build>=0.8,<1"]
40
+ build-backend = "uv_build"
41
+
42
+ [dependency-groups]
43
+ dev = [
44
+ "cython>=3.1", # tests that build a profiled extension (evidence over Cython)
45
+ "pytest>=8",
46
+ "pytest-cov>=5",
47
+ "ruff>=0.5",
48
+ "setuptools", # builds those extensions
49
+ "ty==0.0.84", # pre-1.0: pinned, since new releases add checks
50
+ ]
51
+ docs = [
52
+ "zensical==0.0.68", # pre-1.0: pinned
53
+ # Versioned deployment until Zensical versions natively; not on PyPI.
54
+ "mike @ git+https://github.com/squidfunk/mike.git@2.2.0+zensical-0.1.0",
55
+ ]
56
+
57
+ [tool.ruff]
58
+ line-length = 100
59
+ target-version = "py311"
60
+
61
+ [tool.ruff.lint]
62
+ select = ["E", "F", "I", "UP", "B"]
63
+
64
+ [tool.ty.environment]
65
+ python-version = "3.11" # the oldest supported: newer APIs are flagged
66
+
67
+ [tool.ty.src]
68
+ include = ["src", "tests", "scripts"]
69
+ # A finished spike, kept as the record of what it measured (evidence_design.md).
70
+ exclude = ["scripts/evidence_spike"]
71
+
72
+ [tool.pytest.ini_options]
73
+ testpaths = ["tests"]
@@ -0,0 +1,13 @@
1
+ """Diffcone: static-first, function-level change-impact engine for Python."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ from diffcone.manifest import Manifest, Target, load_manifest
6
+ from diffcone.planner import Plan, plan
7
+
8
+ try:
9
+ __version__ = version("diffcone")
10
+ except PackageNotFoundError: # pragma: no cover - running from a source tree
11
+ __version__ = "0+unknown"
12
+
13
+ __all__ = ["Manifest", "Plan", "Target", "__version__", "load_manifest", "plan"]