diff --git a/docs/development/quickstart.md b/docs/development/quickstart.md index 31f304c8a6c..41ac5ac256a 100644 --- a/docs/development/quickstart.md +++ b/docs/development/quickstart.md @@ -1,15 +1,13 @@ # Hacking Quickstart -- [Hacking Quickstart](#hacking-quickstart) - - [Get the sources](#get-the-sources) - - [Shared requirements](#shared-requirements) - - [Hacking the Python code (front + back)](#hacking-the-python-code-front--back) - - [Run the Python tests](#run-the-python-tests) - - [Run Parsec in local](#run-parsec-in-local) - - [Hacking the Web client (front)](#hacking-the-web-client-front) - - [Start working on the web client](#start-working-on-the-web-client) - - [Hacking the Rust code](#hacking-the-rust-code) - - [If you are working on Mac](#if-you-are-working-on-mac) +- [Get the sources](#get-the-sources) +- [Shared requirements](#shared-requirements) +- [Hacking the Python server](#hacking-the-python-server) + - [Run the Python tests](#run-the-python-tests) +- [Hacking the Web client (front)](#hacking-the-web-client-front) + - [Start working on the web client](#start-working-on-the-web-client) +- [Hacking the Rust code](#hacking-the-rust-code) +- [If you are working on Mac](#if-you-are-working-on-mac) ## Get the sources @@ -113,56 +111,30 @@ To start hacking, follow the basic steps detailed below: ```shell # Create the project virtual with the correct version of Python - poetry env use $(pyenv prefix 3.9.10)/bin/python + poetry env use $(pyenv prefix 3.9.10)/bin/python -C server/pyproject.toml ``` > If you don't have installed `python` with `pyenv`, you need to replace `$(pyenv prefix 3.9.10)/bin/python` with the path where the python you want to use is located. -## Hacking the Python code (front + back) +## Hacking the Python server Once you have installed the [basic requirements](#shared-requirements), you can procede to setup to python virtual env with `poetry`. -1. Install [`Qt5`](https://www.qt.io/). +The python code is located in the folder `server`, The following steps and instruction will consider that you're in that folder. - The `python` application uses `PyQt5`, you need to have `qt5` installed for it to work (it won't even build). - -2. Install FUSE (Linux/MacOS) or WinFsp (Windows) - - Depending on your platform: - - - On Windows: you need to install [`winfsp`](https://github.com/winfsp/winfsp) a the version `1.11.22176` - - You can use `choco` for that - - ```cmd - choco install -y --limit-output winfsp --version=1.11.22176 - ``` - - Or you can use the installer - - > We haven't tried this method so if you can provide feedback if you use it. - - - On MacOS: you need to install `macfuse` - - ```shell - brew install --cask macfuse - ``` - - - On Linux: you need to have installed `libfuse2` - -3. Initialize a poetry env +1. Initialize a poetry env ```shell - poetry install --extra 'core backend' + poetry install ``` -4. Start a shell with the initialized virtual env +2. Start a shell with the initialized virtual env ```shell poetry shell ``` -5. To run parsec do +3. To run parsec do ```shell poetry run parsec @@ -175,80 +147,65 @@ Happy Hacking 🐍 Run the tests with `pytest`: ```shell -poetry run py.test tests +poetry run pytest tests ``` In addition, the following options are available: -| Option | Description | -| ------------------- | --------------------------------------------------------- | -| ``--runmountpoint`` | Include mountpoint tests | -| ``--rungui`` | Include GUI tests | -| ``--runslow`` | Include slow tests | -| ``--postgresql`` | Use PostgreSQL in the backend instead of a mock in memory | -| ``-n 4`` | Run tests in parallel (here `4` jobs) | +| Option | Description | +| ---------------- | --------------------------------------------------------------------------------------------------------- | +| ``--runslow`` | Include slow tests | +| ``--postgresql`` | Use PostgreSQL in the backend instead of a mock in memory
**⚠️ Currently postgresql tests are broken** | +| ``-n 4`` | Run tests in parallel (here `4` jobs) | Note you can mix&match the flags, e.g. ```shell -py.test tests --runmountpoint --postgresql --runslow -n auto +poetry run pytest tests --runslow -n auto ``` -If you want to run GUI test, it is a good idea to install ``pytest-xvfb`` in order to -hide the Qt windows when running the GUI tests - -```shell -apt install xvfb -pip install pytest-xvfb -``` +## Hacking the Web client (front) -### Run Parsec in local +In addition to the [shared requirements](#shared-requirements), you need to install [`Node 18.12.0`](https://nodejs.org/en/download/releases). -You can use the ``run_testenv`` scripts to easily create a development environment: +> You can use [`nvm`](https://github.com/nvm-sh/nvm) to manage multiple node version +> or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) for `Windows` -On Linux and MacOS: + -2. Initialize a poetry env + +1. Initialize a poetry env ```shell - POETRY_LIBPARSEC_BUILD_PROFILE=ci poetry install --extra 'backend' + ./make.py i ``` -3. Install `wasm-pack` + > The python backend is build from the folder `server`. + +2. Install `wasm-pack` Currently we use `wasm-pack@0.11.0`. @@ -260,7 +217,7 @@ In addition to the [shared requirements](#shared-requirements), you need to inst > We install it using cargo because it's the simpler way to specify which version of `wasm-pack` to use. -4. Setup the web binding +3. Setup the web binding ```shell pushd bindings/web @@ -271,7 +228,7 @@ In addition to the [shared requirements](#shared-requirements), you need to inst > You can use `python make.py web-dev-install` instead. -5. Setup the electron binding +4. Setup the electron binding ```shell pushd bindings/electron @@ -282,13 +239,13 @@ In addition to the [shared requirements](#shared-requirements), you need to inst > You can use `python make.py electron-dev-install` instead. -6. Move to the client dir, For the later command we will consider that the current directory is `client` +5. Move to the client dir, For the later command we will consider that the current directory is `client` ```shell cd client ``` -7. Install client dependencies +6. Install client dependencies ```shell npm install @@ -299,11 +256,7 @@ In addition to the [shared requirements](#shared-requirements), you need to inst Before start working on the web client you need to setup a mock server that will provide some mocked data. -1. Make sure you have the latest change for the python testbed server - - ```shell - POETRY_LIBPARSEC_BUILD_PROFILE=ci poetry install --extra 'backend' - ``` +1. Make sure you have the latest change for the python testbed server, see [Initialize a poetry env](#init-web-server-env) 2. Start the testbed server that will provide the mocked data.