|
1 | 1 | # Contribute to development |
2 | | -SQLMesh is licensed under [Apache 2.0](https://github.com/TobikoData/sqlmesh/blob/main/LICENSE). We encourage community contribution and would love for you to get involved. |
| 2 | + |
| 3 | +SQLMesh is licensed under [Apache 2.0](https://github.com/TobikoData/sqlmesh/blob/main/LICENSE). We encourage community contribution and would love for you to get involved. The following document outlines the process to contribute to SQLMesh. |
3 | 4 |
|
4 | 5 | ## Prerequisites |
| 6 | + |
| 7 | +Before you begin, ensure you have the following installed on your machine. Exactly how to install these is dependent on your operating system. |
| 8 | + |
5 | 9 | * Docker |
6 | 10 | * Docker Compose V2 |
7 | 11 | * OpenJDK >= 11 |
8 | 12 | * Python >= 3.9 < 3.13 |
9 | 13 |
|
10 | | -## Commands reference |
| 14 | +## Virtual environment setup |
| 15 | + |
| 16 | +We do recommend using a virtual environment to develop SQLMesh. |
| 17 | + |
| 18 | +```bash |
| 19 | +python -m venv .venv |
| 20 | +source .venv/bin/activate |
| 21 | +``` |
| 22 | + |
| 23 | +Once you have activated your virtual environment, you can install the dependencies by running the following command. |
11 | 24 |
|
12 | | -Install dev dependencies: |
13 | 25 | ```bash |
14 | 26 | make install-dev |
15 | 27 | ``` |
| 28 | + |
| 29 | +Optionally, you can use pre-commit to automatically run linters/formatters: |
| 30 | + |
| 31 | +```bash |
| 32 | +make install-pre-commit |
| 33 | +``` |
| 34 | + |
| 35 | +## Python development |
| 36 | + |
16 | 37 | Run linters and formatters: |
| 38 | + |
17 | 39 | ```bash |
18 | 40 | make style |
19 | 41 | ``` |
| 42 | + |
20 | 43 | Run faster tests for quicker local feedback: |
| 44 | + |
21 | 45 | ```bash |
22 | 46 | make fast-test |
23 | 47 | ``` |
| 48 | + |
24 | 49 | Run more comprehensive tests that run on each commit: |
| 50 | + |
25 | 51 | ```bash |
26 | 52 | make slow-test |
27 | 53 | ``` |
28 | | -Install docs dependencies: |
| 54 | + |
| 55 | +## Documentation |
| 56 | + |
| 57 | +In order to run the documentation server, you will need to install the dependencies by running the following command. |
| 58 | + |
29 | 59 | ```bash |
30 | 60 | make install-doc |
31 | 61 | ``` |
32 | | -Run docs server: |
| 62 | + |
| 63 | +Once you have installed the dependencies, you can run the documentation server by running the following command. |
| 64 | + |
33 | 65 | ```bash |
34 | 66 | make docs-serve |
35 | 67 | ``` |
| 68 | + |
36 | 69 | Run docs tests: |
| 70 | + |
37 | 71 | ```bash |
38 | 72 | make doc-test |
39 | 73 | ``` |
| 74 | + |
| 75 | +## UI development |
| 76 | + |
| 77 | +In addition to the Python development, you can also develop the UI. |
| 78 | + |
| 79 | +The UI is built using React and Typescript. To run the UI, you will need to install the dependencies by running the following command. |
| 80 | + |
| 81 | +```bash |
| 82 | +npm install |
| 83 | +``` |
| 84 | + |
40 | 85 | Run ide: |
| 86 | + |
41 | 87 | ```bash |
42 | 88 | make ui-up |
43 | 89 | ``` |
44 | | -(Optional) Use pre-commit to automatically run linters/formatters: |
| 90 | + |
| 91 | +## Developing the VSCode extension |
| 92 | + |
| 93 | +Similar to UI development, you can also develop the VSCode extension. To do so, make sure you have the dependencies installed by running the following command inside the `vscode/extension` directory. |
| 94 | + |
45 | 95 | ```bash |
46 | | -make install-pre-commit |
| 96 | +npm install |
| 97 | +``` |
| 98 | + |
| 99 | +Once that is done, developing the VSCode extension is most easily done by launching the `Run Extensions` debug task from a Visual Studio Code workspace opened at the root of the SQLMesh repository. By default, the VSCode extension will run the SQLMesh server locally and open a new Visual Studio Code window that allows you to try out the SQLMesh IDE. It opens the `examples/sushi` project by default. To set up Visual Studio Code to run the `Run Extensions` debug task, you can run the following command which will copy the `launch.json` and `tasks.json` files to the `.vscode` directory. |
| 100 | + |
| 101 | +```bash |
| 102 | +make vscode_settings |
47 | 103 | ``` |
0 commit comments