2016-04-07 01:32:09 +02:00
|
|
|
========================
|
|
|
|
OpenSlides Development
|
|
|
|
========================
|
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
Check requirements
|
2016-04-07 01:32:09 +02:00
|
|
|
'''''''''''''''''''''
|
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
- ``docker``
|
|
|
|
- ``docker-compose``
|
|
|
|
- ``git``
|
|
|
|
- ``make``
|
2017-03-07 14:57:48 +01:00
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
**Note about migrating from development
|
|
|
|
setups before version 3.4**: You must set the ``OPENSLIDES_USER_DATA_DIR`` variable in
|
|
|
|
your ``server/personal_data/var/settings.py`` to ``'/app/personal_data/var'``. Another
|
|
|
|
way is to just delete this file. It is recreated with the right paths afterwards.
|
2017-03-07 14:57:48 +01:00
|
|
|
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
Get OpenSlides source code
|
2016-04-07 01:32:09 +02:00
|
|
|
'''''''''''''''''''''''''''''
|
|
|
|
|
|
|
|
Clone current master version from `OpenSlides GitHub repository
|
|
|
|
<https://github.com/OpenSlides/OpenSlides/>`_::
|
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
git clone https://github.com/OpenSlides/OpenSlides.git --recurse-submodules
|
2020-05-28 11:40:41 +02:00
|
|
|
cd OpenSlides
|
2017-03-07 14:57:48 +01:00
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
When updating the repository, submodules must be updated explicitly, too::
|
|
|
|
|
|
|
|
git submodule update
|
2017-03-07 14:57:48 +01:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
Start the development setup
|
|
|
|
''''''''''''''''''''''''''''''
|
2021-01-15 08:05:49 +01:00
|
|
|
Use `make` to start the setup::
|
2018-01-12 08:40:15 +01:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
make run-dev
|
2019-01-24 11:34:20 +01:00
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
All your data (database, config, mediafiles) is stored in ``server/personal_data/var``.
|
|
|
|
To stop the setup press Ctrl+C. To clean up the docker containers run::
|
2019-01-24 11:34:20 +01:00
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
make stop-dev
|
2019-09-12 21:13:45 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
Running the test cases
|
2021-01-15 08:05:49 +01:00
|
|
|
'''''''''''''''''''''''
|
2020-05-28 11:40:41 +02:00
|
|
|
For all services in submodules check out the documentation there.
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
Server tests and scripts
|
|
|
|
-------------------------
|
2020-05-28 11:40:41 +02:00
|
|
|
You need to have python (>=3.8) and python-venv installed. Change your workdirectory to the server::
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
cd server
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
Setup an python virtual environment. If you have already done it, you can skip this step::
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
python3 -m venv .venv
|
|
|
|
source .venv/bin/activate
|
|
|
|
pip install -U -r requirements.txt
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
Make sure you are using the correct python version (e.g. try with explicit minor version: ``python3.8``). Activate it::
|
2016-08-20 10:07:56 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
source .venv/bin/activate
|
2016-08-20 10:07:56 +02:00
|
|
|
|
2021-01-15 08:05:49 +01:00
|
|
|
To deactivate it type ``deactivate``. Running all tests and linters::
|
2016-08-20 10:07:56 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
black openslides/ tests/
|
|
|
|
flake8 openslides/ tests/
|
|
|
|
mypy openslides/ tests/
|
|
|
|
isort -rc openslides/ tests/
|
|
|
|
pytest tests/
|
2017-03-07 14:57:48 +01:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
Client tests
|
2021-01-15 08:05:49 +01:00
|
|
|
-------------
|
2020-05-28 11:40:41 +02:00
|
|
|
You need `node` and `npm` installed. Change to the client's directory. For the first time, install all dependencies::
|
2017-03-07 14:57:48 +01:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
cd client/
|
|
|
|
npm install
|
2018-10-13 08:41:51 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
Run client tests::
|
2017-03-07 14:57:48 +01:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
npm test
|
2016-08-20 10:07:56 +02:00
|
|
|
|
2018-10-13 08:41:51 +02:00
|
|
|
Fix the code format and lint it with::
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
npm run cleanup
|
2017-10-29 10:52:57 +01:00
|
|
|
|
2018-10-13 08:41:51 +02:00
|
|
|
To extract translations run::
|
|
|
|
|
2020-05-28 11:40:41 +02:00
|
|
|
npm run extract
|