diffgenome 0.1.0__tar.gz → 0.1.1__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.
- {diffgenome-0.1.0 → diffgenome-0.1.1}/PKG-INFO +6 -3
- {diffgenome-0.1.0 → diffgenome-0.1.1}/README.md +5 -2
- {diffgenome-0.1.0 → diffgenome-0.1.1}/pyproject.toml +1 -1
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/__init__.py +1 -1
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/collect/py_runtime.py +20 -2
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_packaging.py +12 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/.gitignore +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/LICENSE +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/README.md +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/groundtruth/test_end_to_end.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/pytest.ini +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/shop/__init__.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/shop/controller.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/shop/inventory_service.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/shop/order_service.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/shop/price_repository.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/shop/pricing_service.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/tests/test_controller.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/tests/test_order_service.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp01_shop/tests/test_pricing_service.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/README.md +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/groundtruth/test_end_to_end.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/proc/__init__.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/proc/pipeline.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/proc/processor.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/proc/repository.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/proc/settings.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/pytest.ini +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/tests/__init__.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/tests/test_pipeline.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/fixtures/exp07_state/tests/test_processor.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/__main__.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/go/dg/dg.go +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/go/go.mod +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/go/instrument/facts.go +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/go/instrument/main.go +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/node/instrument.js +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/node/jest-setup.js +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/node/package-lock.json +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/node/package.json +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/_collectors/node/runtime.js +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/ambiguity.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/api.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/change.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/change_artifact.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/collect/__init__.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/collect/go_test.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/collect/node_jest.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/collect/py_monitoring.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/collect/py_symbols.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/collect/pytest_plugin.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/compose.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/dependence.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/evaluate.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/frontends/__init__.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/frontends/python_ir.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/genome.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/genome_pipeline.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/genome_prompt.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/genome_state.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/graph.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/llm.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/model.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/mvp.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/probe.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/projection.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/py.typed +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/render.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/report.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/resolve.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/runtime.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/runtime_evidence.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/sandbox.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/serialize.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/sites.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/static_types.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/src/diffgenome/structure.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/__init__.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_change_artifact.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_collector.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_exp01.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_exp07.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_exp10.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_fixture_repos.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_genome.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_genome_pipeline.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_mechanics.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_model.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_mvp.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_occurrence_binding.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_outcome_boundary.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_rev_index.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_runtime_evidence.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_structure.py +0 -0
- {diffgenome-0.1.0 → diffgenome-0.1.1}/tests/test_value_identity.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: diffgenome
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Runtime evidence for code changes: run a repository's existing tests against a change and report what actually executed.
|
|
5
5
|
Author: karims
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -46,17 +46,20 @@ place an observed outcome on a changed line.
|
|
|
46
46
|
pip install diffgenome
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Python 3.12+ (the Python tracer uses `sys.monitoring
|
|
49
|
+
Python 3.12+ (the Python tracer uses `sys.monitoring`; the target's own interpreter too). No runtime dependencies. Language
|
|
50
50
|
support:
|
|
51
51
|
|
|
52
52
|
| target | tests run with | needs |
|
|
53
53
|
|---|---|---|
|
|
54
54
|
| Python | pytest | the target's virtualenv (`--python`) |
|
|
55
|
-
| Go | `go test` | a Go toolchain with the module's dependencies
|
|
55
|
+
| Go | `go test` | a Go 1.22+ toolchain (it also builds the instrumenter; older modules are fine) with the module's dependencies downloaded (`go mod download`); tests run offline |
|
|
56
56
|
| Node / TypeScript | Jest | the target's `node_modules` (TypeScript is taken from there, or from `DIFFGENOME_NODE_PATH`) |
|
|
57
57
|
|
|
58
58
|
Tests run inside a disposable copy of the repository (never the checkout itself), under a
|
|
59
59
|
sandbox with no network unless `--allow-loopback` is given for local test services.
|
|
60
|
+
The sandbox in 0.1.0 is macOS `sandbox-exec`: on hosts without a supported sandbox (Linux
|
|
61
|
+
today, including Linux CI runners) diffgenome refuses to run target tests and says so, so in
|
|
62
|
+
CI use a macOS runner.
|
|
60
63
|
|
|
61
64
|
## Use
|
|
62
65
|
|
|
@@ -25,17 +25,20 @@ place an observed outcome on a changed line.
|
|
|
25
25
|
pip install diffgenome
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Python 3.12+ (the Python tracer uses `sys.monitoring
|
|
28
|
+
Python 3.12+ (the Python tracer uses `sys.monitoring`; the target's own interpreter too). No runtime dependencies. Language
|
|
29
29
|
support:
|
|
30
30
|
|
|
31
31
|
| target | tests run with | needs |
|
|
32
32
|
|---|---|---|
|
|
33
33
|
| Python | pytest | the target's virtualenv (`--python`) |
|
|
34
|
-
| Go | `go test` | a Go toolchain with the module's dependencies
|
|
34
|
+
| Go | `go test` | a Go 1.22+ toolchain (it also builds the instrumenter; older modules are fine) with the module's dependencies downloaded (`go mod download`); tests run offline |
|
|
35
35
|
| Node / TypeScript | Jest | the target's `node_modules` (TypeScript is taken from there, or from `DIFFGENOME_NODE_PATH`) |
|
|
36
36
|
|
|
37
37
|
Tests run inside a disposable copy of the repository (never the checkout itself), under a
|
|
38
38
|
sandbox with no network unless `--allow-loopback` is given for local test services.
|
|
39
|
+
The sandbox in 0.1.0 is macOS `sandbox-exec`: on hosts without a supported sandbox (Linux
|
|
40
|
+
today, including Linux CI runners) diffgenome refuses to run target tests and says so, so in
|
|
41
|
+
CI use a macOS runner.
|
|
39
42
|
|
|
40
43
|
## Use
|
|
41
44
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "diffgenome"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.1"
|
|
8
8
|
description = "Runtime evidence for code changes: run a repository's existing tests against a change and report what actually executed."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
# 3.12+ is required: the Python tracer is built on sys.monitoring (PEP 669).
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import ast
|
|
6
|
+
import shutil
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
|
|
8
9
|
from diffgenome.collect.py_symbols import PythonSymbolIndex
|
|
@@ -12,7 +13,23 @@ from diffgenome.runtime import SymbolIndex
|
|
|
12
13
|
from diffgenome.sandbox import Workspace
|
|
13
14
|
from diffgenome.serialize import execution_from_json
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
DIFFGENOME_PACKAGE = Path(__file__).resolve().parents[1]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def isolated_import_root(ws_root: Path) -> Path:
|
|
20
|
+
"""A directory holding only the `diffgenome` package, for the target's PYTHONPATH.
|
|
21
|
+
|
|
22
|
+
The package's parent is `src/` in a checkout but the whole host `site-packages` when
|
|
23
|
+
installed; putting that on the target's PYTHONPATH would shadow the target's own
|
|
24
|
+
packages (pytest, pydantic, ...) with the host's, built for another interpreter.
|
|
25
|
+
"""
|
|
26
|
+
root = ws_root / "diffgenome-import"
|
|
27
|
+
if not (root / "diffgenome").is_dir():
|
|
28
|
+
shutil.copytree(
|
|
29
|
+
DIFFGENOME_PACKAGE, root / "diffgenome",
|
|
30
|
+
ignore=shutil.ignore_patterns("__pycache__", "_collectors", "node_modules"),
|
|
31
|
+
)
|
|
32
|
+
return root
|
|
16
33
|
|
|
17
34
|
|
|
18
35
|
class PytestRuntime:
|
|
@@ -69,7 +86,8 @@ class PytestRuntime:
|
|
|
69
86
|
*(only if only else [self.tests]),
|
|
70
87
|
] # fmt: skip
|
|
71
88
|
roots = [str(ws.repo / p) for p in self.pythonpath]
|
|
72
|
-
|
|
89
|
+
roots.append(str(isolated_import_root(ws.root)))
|
|
90
|
+
env = {**self.test_env, "PYTHONPATH": ":".join(roots)}
|
|
73
91
|
result = ws.run(argv, env=env, timeout=1800, allow_loopback=self.allow_loopback)
|
|
74
92
|
out_dir.mkdir(parents=True, exist_ok=True)
|
|
75
93
|
copy_probe_traces(traces_ws, out_dir)
|
|
@@ -22,3 +22,15 @@ def test_collectors_ship_inside_the_package() -> None:
|
|
|
22
22
|
root = Path(diffgenome.__file__).parent / "_collectors"
|
|
23
23
|
assert (root / "go" / "instrument" / "main.go").is_file()
|
|
24
24
|
assert (root / "node" / "instrument.js").is_file()
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_target_pythonpath_exposes_only_the_diffgenome_package(tmp_path: Path) -> None:
|
|
28
|
+
"""Installed, the package's parent is the host site-packages: putting it on the target's
|
|
29
|
+
PYTHONPATH shadowed the target's pytest/pydantic with the host's (Baserow, 0.1.0)."""
|
|
30
|
+
from diffgenome.collect.py_runtime import isolated_import_root
|
|
31
|
+
|
|
32
|
+
root = isolated_import_root(tmp_path)
|
|
33
|
+
assert [p.name for p in root.iterdir()] == ["diffgenome"]
|
|
34
|
+
assert (root / "diffgenome" / "collect" / "pytest_plugin.py").is_file()
|
|
35
|
+
assert not (root / "diffgenome" / "_collectors").exists()
|
|
36
|
+
assert root.resolve() != Path(diffgenome.__file__).resolve().parents[1]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|