|
|
# Installation of the Development Environment
|
|
|
|
|
|
It is highly recommended to set up a virtual environment for JetConf development. The following procedure uses the [venv](https://docs.python.org/3/library/venv.html) module for this purpose (it is included in the standard Python library since version 3.3).
|
|
|
|
|
|
1. Install the latest stable Python 3 version.
|
|
|
|
|
|
1. Clone the JetConf project in a directory of your choice:
|
|
|
```
|
|
|
$ git clone git@gitlab.labs.nic.cz:labs/jetconf.git
|
|
|
```
|
|
|
|
|
|
1. Create the virtual environment:
|
|
|
```
|
|
|
$ pyvenv jetconf
|
|
|
```
|
|
|
|
|
|
1. Activate the virtual environment:
|
|
|
```
|
|
|
$ cd jetconf
|
|
|
$ source bin/activate
|
|
|
```
|
|
|
|
|
|
1. Install all required packages inside the virtual environment:
|
|
|
```
|
|
|
$ pip install -r requirements
|
|
|
```
|
|
|
|
|
|
When inside the virtual environment, the shell prompt should change to something like
|
|
|
```
|
|
|
(jetconf) $
|
|
|
```
|
|
|
|
|
|
To leave the virtual environment, just do
|
|
|
```
|
|
|
$ deactivate
|
|
|
```
|
|
|
|
|
|
The virtual environment can be entered anytime later by executing step 4. The other steps need to be performed just once.
|
|
|
|
|
|
The setup described above has a few consequences that have to be kept in mind:
|
|
|
|
|
|
* Any project files that need to go to `bin` (executable Python scripts), `include` or `lib` have to be added as exceptions to `.gitignore`, for example
|
|
|
```
|
|
|
!bin/jetconf
|
|
|
```
|
|
|
|
|
|
* After adding a new Python module dependency, it is necessary to run
|
|
|
```
|
|
|
$ pip freeze > requirements.txt
|
|
|
```
|
|
|
and _commit_ the new content of `requirements.txt`.
|
|
|
|