Installation
============

Installation of the Modelverse is rather simple, as is its simple usage.
We first introduce the dependencies of the Modelverse, followed by installation instructions for the Modelverse itself.
To check whether or not the installation was successful, users can run the enclosed tests.

Dependencies
------------

The Modelverse reference implementation is relatively dependency-free.
As its code is written in Python 2, a working Python 2.7 interpreter is necessary.
To run the server, the `SCCD <https://msdl.uantwerpen.be/git/simon/SCCD>`_ module needs to be installed.
Full installation instructions can be found on the project website.

To run the tests, the `pytest <http://docs.pytest.org/en/latest/>`_ module must be installed.
In case you want to use PyPy, which often offers increased performance, you need to install both dependencies in PyPy as well.
Next, we document how this is done.

PyPy
^^^^

For SCCD, you can simply install it using PyPy instead of CPython.

For pytest, you also need to install all of pytest's dependencies, and pytest itself.
The easiest way to do this is through *pip*, which you also have to install first for PyPy::

    wget https://msdl.uantwerpen.be/files/get-pip.py
    pypy get-pip.py --user
    pypy -m pip install pytest --user

Installation
------------

The Modelverse is merely a set of Python scripts, and there is no real installation, except for its dependencies.
As such, you will only have to download the source code and are ready to use the Modelverse.

To install the Modelverse, download the `Modelverse source code <https://msdl.uantwerpen.be/git/yentl/modelverse>`_.
This can be done through git::

    git clone https://msdl.uantwerpen.be/git/yentl/modelverse

Or using your favorite HTTP download tool::

    wget https://msdl.uantwerpen.be/git/yentl/modelverse/archive/master.zip
    unzip master.zip

You can now run the scripts in the *scripts/* directory using Python.
In the next section, we go deeper into the relevant scripts.

Tests
-----

To make sure that everything is working correctly, you can execute the tests with the script *scripts/run_tests.sh*.

Executing the tests is as simple as the following command::

    python scripts/run_tests.py

.. note::

   If you prefer to use PyPy, you can similarly execute it by replacing *python* with *pypy*.
   All occurences of *python* can be replaced by *pypy*, as long as both implement Python 2.7.

This will run a set of tests for all different projects.
Note that this also causes some bootstrap files to be created, which might take some time on slow machines, certainly if PyPy is not used.
A faster alternative is to run the faster tests, though this will not test the creation of bootstrap files::

    python scripts/run_fast_tests.py
