Metadata-Version: 2.4
Name: adaptive-tests-py
Version: 0.2.0
Summary: Adaptive test discovery for Python projects
Author-email: Jason Kempf <jasonkempf@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/anon57396/adaptive-tests
Project-URL: Repository, https://github.com/anon57396/adaptive-tests
Project-URL: Issues, https://github.com/anon57396/adaptive-tests/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# adaptive-tests-py

Python port of the adaptive discovery engine. It mirrors the JavaScript API so polyglot teams can keep their testing strategy consistent across stacks while preserving the zero-runtime guarantees of static analysis.

## Installation

```bash
pip install adaptive-tests-py
```

## Usage

```python
from adaptive_tests_py import DiscoveryEngine, Signature

engine = DiscoveryEngine(root=".")
result = engine.discover(
    Signature(name="TodoService", methods=["add", "complete", "list"]),
    load=False,
)

print(result.module, result.methods)
TodoService = result.load()  # module imported on demand
service = TodoService()
service.add("Ship adaptive tests")
```

Use `engine.discover_all(signature)` to inspect every ranked match when tuning signatures or debugging coverage. The engine now mirrors the JavaScript implementation more closely:

- **Configurable scoring** – drop an `adaptive-tests.config.json` (or pass inline overrides) to tweak path/file/method weighting.
- **Persistent cache** – results are stored in `.adaptive-tests-cache.json` and re-used on future runs when the target file is unchanged.
- **Lens explanations** – call `engine.explain(signature)` to retrieve top candidates with per-factor score breakdowns.

### CLI

The package ships with a lightweight CLI so you can run discovery diagnostics without writing code:

```bash
adaptive-tests-py why '{"name": "TodoService"}' --root examples/python/src --limit 3
adaptive-tests-py why signature.json --json
adaptive-tests-py discover '{"name": "TodoService"}' --root .
```

Use `--no-cache` for a fresh scan and `--config path/to/config.json` to supply overrides ad-hoc.

### Python Example Project

See `examples/python/` for a full pytest demo, custom configuration, and advanced signatures.
