Setup¶
Prerequisites¶
Ubuntu >= 24.04 or macOS >= 15 (with Homebrew).
Python >= 3.12 (see pyenv).
A copy of the source code (see Clone the Repository).
Note
All of the commands below should be run from the root of the repository.
Setup¶
To setup a development environment, first install the necessary development dependencies:
sudo bash dependencies/development.{operating-system}.sh
Where {operating-system} is either ubuntu or macos.
Warning
There are some dependencies that the scripts cannot install automatically for you - please check the output for warnings and more information.
Note
Python packages should be installed in a Virtual Environment for development purposes. If you’re not familiar with using Virtual Environments, go brush up on them now.
Then install the Python package with pip in editable mode, with extras for
development, and with frozen dependencies:
pip install -e .[development] -c constraints.txt
Code Style¶
Pre-commit hooks are available for automatic code formatting, linting, and type checking. To enable them (after installing development dependencies) run:
pre-commit install
Documentation¶
To build the documentation (after Setup), from the docs/
directory run:
make html
Or other supported sphinx output formats.
Extras¶
Installing Ghidra on MacOS¶
In general, you should follow Ghidra’s installation instructions, but here are a few tips.
Install OpenJDK with Homebrew
brew install openjdk
Download and extract a Ghidra release directly from GitHub. The directory scheme
/opt/ghidra/{version}/works well.Disable MacOS code verification for Ghidra, otherwise you will have to auth every time you want to run it.
xattr -dr com.apple.quarantine /opt/ghidra/
Make sure you set the
GHIDRA_INSTALL_DIRenvironment variable when running scripts that use Ghidra.GHIDRA_INSTALL_DIR=/opt/ghidra/11.4.1/ \ python -m undertale ...