installation.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Installation
  2. ============
  3. Dependencies
  4. ------------
  5. The Modelverse reference implementation is relatively dependency-free.
  6. As its code is written in Python 2, a working Python 2.7 interpreter is necessary.
  7. To run the tests, this interpreter needs to have the `pytest <http://docs.pytest.org/en/latest/>`_ module installed.
  8. To run the server, the `SCCD <https://msdl.uantwerpen.be/git/simon/SCCD>`_ module needs to be installed.
  9. Installation
  10. ------------
  11. The Modelverse is merely a set of Python scripts, and there is no real installation, except for its dependencies.
  12. As such, you will only have to download the source code and are ready to use the Modelverse.
  13. 0. Install dependencies.
  14. 1. Download the `Modelverse source code <https://msdl.uantwerpen.be/git/yentl/modelverse>`_.
  15. For example using git::
  16. git clone https://msdl.uantwerpen.be/git/yentl/modelverse
  17. Or using your favorite HTTP download tool::
  18. wget https://msdl.uantwerpen.be/git/yentl/modelverse/archive/master.zip
  19. unzip master.zip
  20. 2. That's it! You can now run the scripts in the *scripts/* directory using Python.
  21. Tests
  22. -----
  23. To make sure that everything is working correctly, you can execute the tests with the script *scripts/run_tests.sh*.
  24. Executing the tests is as simple as the following command::
  25. python scripts/run_tests.py
  26. This will run a set of tests for all different projects.
  27. Note that this also causes some bootstrap files to be created, which might take some time on slow machines.
  28. A faster alternative is to only run the overall tests::
  29. python -m pytest integration
  30. PyPy
  31. ^^^^
  32. The default way of executing tests is probably through CPython.
  33. Note, however, that CPython is a slow implementation of Python, which makes everything in the Modelverse slower.
  34. While it is not impossible to use CPython, using PyPy is recommended for the server!
  35. Nonetheless, PyPy is often not the default interpreter.
  36. You will therefore have to explicitly give control to PyPy instead of CPython.
  37. This is fairly simple: all scripts in *scripts/* execute their subprocesses using the Python interpreter used to start the script.
  38. As such, the following command suffices to execute the Modelverse tests using PyPy::
  39. pypy scripts/run_tests.py
  40. The problem, however, is that all modules need to be readily installed on PyPy.
  41. For SCCD, you can simply install it using PyPy instead of CPython.
  42. For pytest, you also need to install all of pytest's dependencies.
  43. The easiest way to do this is through *pip*, which you also have to install first::
  44. wget https://msdl.uantwerpen.be/files/get-pip.py
  45. pypy get-pip.py --user
  46. pypy -m pip install pytest --user
  47. Afterwards, you can simply run::
  48. pypy scripts/run_tests.py
  49. To execute the tests using PyPy.