Metadata-Version: 2.4
Name: depyore
Version: 0.1.0
Summary: Recover historical Python and Node dependency environments
License-Expression: MIT
Project-URL: Repository, https://github.com/Unique50101/depyore
Project-URL: Homepage, https://uniqueoss.com
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: packaging>=24
Dynamic: license-file

# Depyore

Bring old code back to life. Depyore reads a checkout, finds clues about its original runtime, and asks uv or npm to rebuild its dependencies. It writes a separate environment and a JSON report. Free under MIT. No AI key.

## Try a recovery

Install Python 3.11+ and uv. For Node projects, also install Node.js and npm.

```sh
pip install depyore
depyore scan .
depyore restore . --date 2021-12-31 --verify check.py
```

From a checkout of this repository, try either included example:

```sh
depyore restore examples/python --date 2021-12-31 --verify check.py
depyore restore examples/node --date 2021-12-31 --verify check.cjs
```

| Stage | What you get |
| --- | --- |
| Scan | Latest Git commit date affecting the directory, runtime hints from .python-version, pyproject.toml, .nvmrc or package.json, and undeclared import candidates. Use --date for a known working date. |
| Restore | uv resolves wheels uploaded by the end of that UTC date. npm uses the existing lockfile when present, otherwise resolves by date. Every run gets its own .depyore directory. |
| Verify | A test script you select runs against the recovered dependencies. The report records whether it ran and passed. Run only trusted projects and tests. These environments share your account permissions. |
| Investigate | Run a passing Python baseline, then replace one direct or transitive pin per trial and rerun the same test. A failure identifies a candidate regression for that test. |
| Audit | Add --audit to query OSV for the recovered package names and versions. The advisory IDs are stored in report.json. An empty response only covers known advisories. |

```sh
depyore investigate examples/python --date 2021-12-31 --verify check.py --try-pin colorama==0.4.6
```

The report compares the versions visible to the scanning Python interpreter or installed in the source project's node_modules with recovered versions. Missing import candidates require review before adding them to a manifest. Python module names can differ from package names. Python projects need PEP 508 dependencies in requirements.txt or project.dependencies. Editable installs, requirements-file options, source-only Python releases, npm workspaces and native install scripts are outside this release. A failed check exits nonzero and retains its run directory for inspection. Repeated runs leave earlier results available.

Python recovery requests the declared interpreter from uv, or uses the current interpreter if no hint exists. Node recovery reads numeric major, minor or patch hints from .nvmrc or engines.node. If the installed runtime differs, it requests a dated Node binary from npm and runs the verification script with it. Complex engine ranges use the installed Node and npm engine validation. A Git date is a clue, and later maintenance commits can make an explicit date more accurate.

## Node CLI

With uv installed, `npx depyore scan .` launches the same version of the Python engine via uvx. The npm package is a lightweight launcher.

## GitHub Action

```yaml
steps:
  - uses: actions/checkout@v4
    with:
      fetch-depth: 0
  - uses: Unique50101/depyore@v0.1.0
    with:
      path: .
```

The action scans the checkout without running project code. Run the restore and investigate commands on trusted projects in your own environment.
