Skip to content

Development

Christian Kauten edited this page Jan 6, 2019 · 5 revisions

Development circumvents setuptools (because it's a complete pain to use). Use these instructions to get a development environment running.

Setup

Fork & Clone

It is recommended to fork the project to your GitHub account before getting started. This will facilitate integrating your changes with a pull request!

Install C++ Requirements

nes-py should run on any Unix system that is compatible with the following tools.

  • SConstruct
  • C++11 compatible compiler (e.g. clang++, g++, MSVC)

Debian-based systems

sudo apt-get install clang scons

MacOS

brew install scons

Install Python Requirements

nes-py has a few Python dependencies as well enumerated in requirements.txt. To install these run the following from the top level of the repository:

python -m pip install -r requirements.txt

Compilation

The SConstruct script at the top level of the repository contains instructions to compile the dependent LaiNES C++ code into a shared object library nes_py/laines/build/lib_nes_env.so. To run SConsstruct execute the following command from the top level of the repository:

scons

Testing

Test cases are all written in python in tests packages inside the package that they test. To recursively find and execute all test cases run the following from the top level directory:

python -m unittest discover .

Development CLI

__main__.py contains simple logic to start the command line interface from the repository. To run the CLI, execute the following from the top level of the repository:

python . <arguments>

where <arguments> is any number of arguments to pass to the CLI. pass -h to print out documentation for the interface.