Metadata-Version: 2.4
Name: open-prime-rando
Version: 0.20.0
Summary: An open source randomizer patcher for Metroid Prime 2 and 3.
Author: Henrique Gemignani
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/randovania/open-prime-rando
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: retro-data-structures>=0.44.1
Requires-Dist: jsonschema>=4.0.0
Requires-Dist: ppc-asm>=1.9.0
Requires-Dist: py_randomprime
Requires-Dist: pydantic>=2.12.5
Requires-Dist: pyelftools>=0.32
Requires-Dist: open-prime-rando-practice-mod>=0.2.3
Provides-Extra: nod
Requires-Dist: nod_rs; extra == "nod"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Requires-Dist: pre-commit; extra == "test"
Dynamic: license-file

# Open Prime Rando
Open Source randomizer patcher for Prime 2 and eventually 3.

## Running the patcher standalone

After cloning the repository, install the project and its extras:

```sh
uv sync --all-groups --all-extras
```

The command line entrypoint is `open-prime-rando`. The currently supported game is `echoes`, and the
`randomizer` subcommand expects a configuration JSON plus input and output ISO paths:

```sh
uv run open-prime-rando echoes \
  --input-iso /path/to/prime2.iso \
  --output-iso /path/to/output.iso \
  randomizer \
  --input-json /path/to/config.json
```

Use `uv run open-prime-rando echoes --help` to see the available arguments for the Echoes patcher.

# Updating hash files

Some tests compare the output of the patcher against pre-recorded hash files. When a code change intentionally alters the output, these files need to be regenerated.

## Setup

The tests require ISO files for Metroid Prime 2: Echoes. Create a `.env` file in the repository root:

```
PRIME2_ISO=/path/to/prime2_ntsc.iso
PRIME2_PAL_ISO=/path/to/prime2_pal.iso
```

> These can also be set as regular environment variables instead of using `.env`.

## Running locally

```sh
uv run pytest --update-hashes -n 2
```

This runs only the hash-comparison tests and writes the new hashes in place of the old ones.

## Via GitHub (pull requests)

Anyone with write access to the repository can comment `/update-hashes` on a pull request. A workflow will run the tests on the self-hosted runner, commit the updated files, and push them to the PR branch.

# Credits

# Echoes

Banner image created by rekameohs.
