rad-ox-drift-bridge 0.13.3__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lukasz Radkiewicz (rad-ox)
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,120 @@
1
+ Metadata-Version: 2.2
2
+ Name: rad-ox-drift-bridge
3
+ Version: 0.13.3
4
+ Summary: Zero-dependency MIT Python 3 test bridge (pytest / unittest) for DRIFT 0.3 behaviour contracts.
5
+ Author-email: Lukasz Radkiewicz <rad-ox@users.noreply.github.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/rad-ox/drift
8
+ Project-URL: Repository, https://github.com/rad-ox/drift
9
+ Project-URL: Documentation, https://github.com/rad-ox/drift/blob/main/docs/bridges.md
10
+ Project-URL: Issues, https://github.com/rad-ox/drift/issues
11
+ Keywords: drift,test-integrity,ai-agents,coding-agents,release-gate,pytest,unittest
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
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
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+
26
+ # rad-ox-drift-bridge
27
+
28
+ Zero-dependency MIT Python 3 test bridge for [DRIFT](https://github.com/rad-ox/drift) 0.3 behaviour contracts.
29
+
30
+ - **Zero runtime dependencies**: Python 3.11+ standard library only (Python 3.14 supported).
31
+ - **Lean test dependency**: published separately from `rad-ox-drift-verify` so test suites do not pull in CLI/SARIF/verifier tooling.
32
+ - **Compatible imports**: use `from drift_bridge import run_drift_case` (recommended) or the top-level compatibility module `import drift` — both share the same runtime state and caches without colliding with `rad-ox-drift-verify`.
33
+ - **Framework agnostic**: works with `pytest` and standard-library `unittest`.
34
+
35
+ ## Installation
36
+
37
+ Install as a test dependency from PyPI:
38
+
39
+ ```bash
40
+ pip install rad-ox-drift-bridge
41
+ ```
42
+
43
+ To also verify proof events in CI using the zero-binary MIT verifier:
44
+
45
+ ```bash
46
+ pip install rad-ox-drift-verify
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ ### pytest
52
+
53
+ ```python
54
+ from drift_bridge import run_drift_case
55
+
56
+
57
+ def test_returns_existing_item():
58
+ def verify(d):
59
+ res = send(d.when("found", "request"))
60
+ d.check("found", {"status": res.status, "name": res.name})
61
+
62
+ run_drift_case(
63
+ contract="item-get",
64
+ test="test_items.py#test_returns_existing_item",
65
+ cases=["found"],
66
+ level="http",
67
+ fn=verify,
68
+ strict_when=True,
69
+ )
70
+ ```
71
+
72
+ ### unittest (with `import drift` compatibility shim)
73
+
74
+ ```python
75
+ import unittest
76
+ import drift
77
+
78
+
79
+ class ItemContractTest(unittest.TestCase):
80
+ def test_returns_existing_item(self):
81
+ def verify(d):
82
+ res = send(d.when("found", "request"))
83
+ d.check("found", {"status": res.status, "name": res.name})
84
+
85
+ drift.run_drift_case(
86
+ contract="item-get",
87
+ test="ItemContractTest#test_returns_existing_item",
88
+ cases=["found"],
89
+ level="http",
90
+ fn=verify,
91
+ )
92
+ ```
93
+
94
+ ## Running the Proof Gate
95
+
96
+ Export resolved contract views, run your tests, and verify the proof gate:
97
+
98
+ ```bash
99
+ drift show .drift/contracts --as json --out .drift/resolved
100
+ DRIFT_RESOLVED=.drift/resolved DRIFT_EVENTS=.drift/events pytest
101
+ drift gate .drift/contracts --events .drift/events
102
+ ```
103
+
104
+ Or cross-verify emitted proof events using the standalone MIT verifier:
105
+
106
+ ```bash
107
+ drift-verify .drift/contracts --config .drift/config.toml --events .drift/events
108
+ ```
109
+
110
+ ## Documentation
111
+
112
+ - [DRIFT Repository](https://github.com/rad-ox/drift)
113
+ - [Polyglot Bridges & Observation Protocol](https://github.com/rad-ox/drift/blob/main/docs/bridges.md)
114
+ - [DRIFT Practical Guide](https://github.com/rad-ox/drift/blob/main/GUIDE.md)
115
+ - [Installation Guide](https://github.com/rad-ox/drift/blob/main/INSTALL.md)
116
+ - [Issue Tracker](https://github.com/rad-ox/drift/issues)
117
+
118
+ ## License
119
+
120
+ Licensed under the [MIT License](https://github.com/rad-ox/drift/blob/main/LICENSE).
@@ -0,0 +1,95 @@
1
+ # rad-ox-drift-bridge
2
+
3
+ Zero-dependency MIT Python 3 test bridge for [DRIFT](https://github.com/rad-ox/drift) 0.3 behaviour contracts.
4
+
5
+ - **Zero runtime dependencies**: Python 3.11+ standard library only (Python 3.14 supported).
6
+ - **Lean test dependency**: published separately from `rad-ox-drift-verify` so test suites do not pull in CLI/SARIF/verifier tooling.
7
+ - **Compatible imports**: use `from drift_bridge import run_drift_case` (recommended) or the top-level compatibility module `import drift` — both share the same runtime state and caches without colliding with `rad-ox-drift-verify`.
8
+ - **Framework agnostic**: works with `pytest` and standard-library `unittest`.
9
+
10
+ ## Installation
11
+
12
+ Install as a test dependency from PyPI:
13
+
14
+ ```bash
15
+ pip install rad-ox-drift-bridge
16
+ ```
17
+
18
+ To also verify proof events in CI using the zero-binary MIT verifier:
19
+
20
+ ```bash
21
+ pip install rad-ox-drift-verify
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### pytest
27
+
28
+ ```python
29
+ from drift_bridge import run_drift_case
30
+
31
+
32
+ def test_returns_existing_item():
33
+ def verify(d):
34
+ res = send(d.when("found", "request"))
35
+ d.check("found", {"status": res.status, "name": res.name})
36
+
37
+ run_drift_case(
38
+ contract="item-get",
39
+ test="test_items.py#test_returns_existing_item",
40
+ cases=["found"],
41
+ level="http",
42
+ fn=verify,
43
+ strict_when=True,
44
+ )
45
+ ```
46
+
47
+ ### unittest (with `import drift` compatibility shim)
48
+
49
+ ```python
50
+ import unittest
51
+ import drift
52
+
53
+
54
+ class ItemContractTest(unittest.TestCase):
55
+ def test_returns_existing_item(self):
56
+ def verify(d):
57
+ res = send(d.when("found", "request"))
58
+ d.check("found", {"status": res.status, "name": res.name})
59
+
60
+ drift.run_drift_case(
61
+ contract="item-get",
62
+ test="ItemContractTest#test_returns_existing_item",
63
+ cases=["found"],
64
+ level="http",
65
+ fn=verify,
66
+ )
67
+ ```
68
+
69
+ ## Running the Proof Gate
70
+
71
+ Export resolved contract views, run your tests, and verify the proof gate:
72
+
73
+ ```bash
74
+ drift show .drift/contracts --as json --out .drift/resolved
75
+ DRIFT_RESOLVED=.drift/resolved DRIFT_EVENTS=.drift/events pytest
76
+ drift gate .drift/contracts --events .drift/events
77
+ ```
78
+
79
+ Or cross-verify emitted proof events using the standalone MIT verifier:
80
+
81
+ ```bash
82
+ drift-verify .drift/contracts --config .drift/config.toml --events .drift/events
83
+ ```
84
+
85
+ ## Documentation
86
+
87
+ - [DRIFT Repository](https://github.com/rad-ox/drift)
88
+ - [Polyglot Bridges & Observation Protocol](https://github.com/rad-ox/drift/blob/main/docs/bridges.md)
89
+ - [DRIFT Practical Guide](https://github.com/rad-ox/drift/blob/main/GUIDE.md)
90
+ - [Installation Guide](https://github.com/rad-ox/drift/blob/main/INSTALL.md)
91
+ - [Issue Tracker](https://github.com/rad-ox/drift/issues)
92
+
93
+ ## License
94
+
95
+ Licensed under the [MIT License](https://github.com/rad-ox/drift/blob/main/LICENSE).
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rad-ox-drift-bridge"
7
+ version = "0.13.3"
8
+ description = "Zero-dependency MIT Python 3 test bridge (pytest / unittest) for DRIFT 0.3 behaviour contracts."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Lukasz Radkiewicz", email = "rad-ox@users.noreply.github.com" }]
13
+ keywords = ["drift", "test-integrity", "ai-agents", "coding-agents", "release-gate", "pytest", "unittest"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Topic :: Software Development :: Quality Assurance",
24
+ "Topic :: Software Development :: Testing",
25
+ ]
26
+ dependencies = []
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/rad-ox/drift"
30
+ Repository = "https://github.com/rad-ox/drift"
31
+ Documentation = "https://github.com/rad-ox/drift/blob/main/docs/bridges.md"
32
+ Issues = "https://github.com/rad-ox/drift/issues"
33
+
34
+ [tool.setuptools]
35
+ package-dir = { "" = "src" }
36
+ packages = ["drift_bridge"]
37
+ py-modules = ["drift"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,10 @@
1
+ """Compatibility shim exposing the DRIFT Python bridge as top-level `import drift`."""
2
+ from __future__ import annotations
3
+
4
+ import sys
5
+
6
+ from drift_bridge import drift as _impl
7
+
8
+ if __name__ == "__main__":
9
+ raise SystemExit(_impl._checks.run_drift_cli(sys.argv[1:]))
10
+ sys.modules[__name__] = _impl
@@ -0,0 +1,36 @@
1
+ """Zero-dependency MIT Python 3 test bridge for DRIFT 0.3 behaviour contracts."""
2
+ from __future__ import annotations
3
+
4
+ from .drift import (
5
+ DriftContext,
6
+ ThenView,
7
+ build_stub,
8
+ build_stub_variants,
9
+ expand_domain,
10
+ flush_all_inventories,
11
+ mutation_depth,
12
+ observe,
13
+ reset_drift_cache,
14
+ run_drift_case,
15
+ select_files,
16
+ should_run,
17
+ verify_stub,
18
+ with_mutation,
19
+ )
20
+
21
+ __all__ = [
22
+ "DriftContext",
23
+ "ThenView",
24
+ "build_stub",
25
+ "build_stub_variants",
26
+ "expand_domain",
27
+ "flush_all_inventories",
28
+ "mutation_depth",
29
+ "observe",
30
+ "reset_drift_cache",
31
+ "run_drift_case",
32
+ "select_files",
33
+ "should_run",
34
+ "verify_stub",
35
+ "with_mutation",
36
+ ]
@@ -0,0 +1,9 @@
1
+ """CLI entrypoint for `python -m drift_bridge`."""
2
+ from __future__ import annotations
3
+
4
+ import sys
5
+
6
+ from . import drift as _drift
7
+
8
+ if __name__ == "__main__":
9
+ raise SystemExit(_drift._checks.run_drift_cli(sys.argv[1:]))