File: install.rst

package info (click to toggle)
python-moderngl-window 2.4.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 69,220 kB
  • sloc: python: 11,387; makefile: 21
file content (83 lines) | stat: -rw-r--r-- 2,178 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

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

Installing with pip
-------------------

moderngl-window is available on PyPI::

    pip install moderngl-window

Optional Dependencies
---------------------

We try to have as few requirements as possible and instead offer
optional dependencies. You can create your own window types
and loaders and don't want to force installing unnecessary dependencies.

By default we install pyglet as this is the default window type
as it small and pretty much work out of the box on all platforms.

Optional dependencies for loaders::

    # Wavefront / obj loading
    pip install moderngl-window[pywavefront]
    # STL loading
    pip install moderngl-window[trimesh]

Installing dependencies for window types::

    pip install moderngl-window[PySide2]
    pip install moderngl-window[pyqt5]
    pip install moderngl-window[glfw]
    pip install moderngl-window[PySDL2]

Installing optional dependencies this way should ensure
a compatible version is installed.

For glfw and sdl2 windows you also need install the library itself.
Thees are also available as packages on linux and homebrew on OS X.
For windows the DLLs can simply be placed in the root of your project.

- GLFW : https://www.glfw.org/
- SDL2 : https://www.libsdl.org/download-2.0.php

Installing from source
----------------------

.. code:: bash

    # clone repo (optionally clone over https)
    git clone git@github.com:moderngl/moderngl-window.git
    cd moderngl-window

    # Create your virtualenv and activate
    # We assume the user knows how to work with virtualenvs

    # Install moderngl-window in editable mode
    pip install -e .

    # Install optional dev dependencies
    pip install -e .[dev]
    pip install -e .[docs]

Installing the package in editable mode will make you able
to run tests and examples. We highly recommend using
virtualenvs.

Running examples
----------------

Assuming you installed from source you should be able to run the examples
in the `examples` directory directly after installing the dev requirements
in the root of the project.

Running tests
-------------

Assuming dev requirements are installed.

Run tests with ``tox``::

    pytest