OpenSlides/DEVELOPMENT.rst

89 lines
2.2 KiB
ReStructuredText
Raw Normal View History

========================
OpenSlides Development
========================
Check requirements
'''''''''''''''''''''
- ``docker``
- ``docker-compose``
- ``git``
- ``make``
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.
Get OpenSlides source code
'''''''''''''''''''''''''''''
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
cd OpenSlides
2021-01-15 08:05:49 +01:00
When updating the repository, submodules must be updated explicitly, too::
git submodule update
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
make run-dev
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::
2021-01-15 08:05:49 +01:00
make stop-dev
2019-09-12 21:13:45 +02:00
Running the test cases
2021-01-15 08:05:49 +01:00
'''''''''''''''''''''''
For all services in submodules check out the documentation there.
2021-01-15 08:05:49 +01:00
Server tests and scripts
-------------------------
You need to have python (>=3.8) and python-venv installed. Change your workdirectory to the server::
cd server
2021-01-15 08:05:49 +01:00
Setup an python virtual environment. If you have already done it, you can skip this step::
python3 -m venv .venv
source .venv/bin/activate
pip install -U -r requirements.txt
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
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
black openslides/ tests/
flake8 openslides/ tests/
mypy openslides/ tests/
isort -rc openslides/ tests/
pytest tests/
Client tests
2021-01-15 08:05:49 +01:00
-------------
You need `node` and `npm` installed. Change to the client's directory. For the first time, install all dependencies::
cd client/
npm install
2018-10-13 08:41:51 +02:00
Run client tests::
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::
npm run cleanup
2017-10-29 10:52:57 +01:00
2018-10-13 08:41:51 +02:00
To extract translations run::
npm run extract