-
Notifications
You must be signed in to change notification settings - Fork 18
Legacy ‐ Installation for development (old version ‐ before v2)
NOTE : The only targeted/tested OS is currently GNU/Linux. However it is very likely that it can work with little change on other UNIX-like (xBSD, MacOS?). An explanation is also for an installation via Docker, which can make a deployment possible for other OS users (notably Windows, FreeBSD or MacOSX)
-
Packages provided by
apt
, based on ubuntu 22.04:
$ sudo apt-get install -y --no-install-recommends \
software-properties-common gcc g++ \
libpython3.11-dev python3.11 python3.11-dev python3-pip \
libgeos-c1v5 libgeos-dev libgdal30 libgdal-dev libspatialindex-dev libffi-dev \
nodejs npm redis-server libuv1 libuv1-dev unzip wget git \
libxslt1.1 libxslt1-dev libxml2 libxml2-dev libkml-dev locales \
-
Other tools needed:
topojson
(required by the application)
$ sudo npm -g install topojson
$ git clone https://github.com/riatelab/magrit
$ cd magrit
$ pip3.11 install -r requirements/dev.txt
$ python3.11 setup.py build_ext --inplace
$ sudo service redis-server start
Go in the client
folder and run npm install
(no need to be root) to install JS dependencies and the various packages required to build the JS code (such as webpack
):
$ cd client/
$ npm install
$ cd ..
With the --dev
argument, js/css files are watched and a transpiled file is automatically built when changes occur.
$ python3.11 magrit_app/app.py -p 9999 --dev
DEBUG:aioredis:Creating tcp connection to ('0.0.0.0', 6379)
INFO:magrit.main:serving on('0.0.0.0', 9999)
....
$ sudo service redis-server start
$ git clone https://github.com/riatelab/magrit
$ cd magrit
$ virtualenv venv -p /usr/bin/python3.11
$ source venv/bin/activate
(venv)$ pip install -r requirements/dev.txt
(venv)$ python setup.py build_ext --inplace
Go in the client
folder and run npm install
(no need to be root) to install JS dependencies and the various packages required to build the JS code (such as webpack
) and build manually the JS code the first time :
$ cd client/
$ npm install
$ npm run build
$ cd ..
With the --dev
argument, js/css files are watched and a transpiled file is automatically built when changes occur.
(venv)$ python magrit_app/app.py -p 9999 --dev
DEBUG:aioredis:Creating tcp connection to ('0.0.0.0', 6379)
INFO:magrit.main:serving on('0.0.0.0', 9999)
....
When started with --dev
argument the application automatically transpile JavaScript files when modified.
If changes relate to the python application you have to restart it for them to be taken into account.