installation.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 statecharts, 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 scripts, and there is no real installation present.
  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. This test file will execute tests in parallel, using as many cores as it can.
  25. Nonetheless, total execution time is still rather slow (e.g., 1200 seconds on a i5-4570 using PyPy).
  26. Executing the tests is as simple as the following command::
  27. python scripts/run_tests.py
  28. This will run a set of tests for all different projects.
  29. PyPy
  30. ^^^^
  31. The default way of executing tests is probably through CPython.
  32. Note, however, that CPython is a very slow implementation of Python, which makes everything in the Modelverse slower.
  33. While it is not impossible to use CPython, using PyPy is highly recommended at the moment!
  34. Nonetheless, PyPy is often not the default interpretter present on the system.
  35. You will therefore have to explicitly give control to PyPy instead of CPython.
  36. This is fairly simple: all scripts in *scripts/* execute their subprocesses using the Python interpreter used to start the script.
  37. As such, the following command suffices to execute the Modelverse tests using PyPy::
  38. pypy scripts/run_tests.py
  39. The problem, however, is that all modules need to be readily installed on PyPy.
  40. For SCCD, you can simply install it using PyPy instead of CPython.
  41. For pytest, you also need to install all of pytest's dependencies.
  42. The easiest way to do this is through *pip*, which you also have to install first::
  43. wget https://bootstrap.pypa.io/get-pip.py
  44. pypy get-pip.py --user
  45. pypy -m pip install pytest --user
  46. Afterwards, you can simply run::
  47. pypy scripts/run_tests.py
  48. To execute the tests using PyPy.