Skip to content

Environments

Set up an environment

NPM

We use commitlint and prettier to format the codes.

# To install commitlint and prettier
npm install --also=dev
# To test commitlint
npx commitlint --from "HEAD~1" --to "HEAD" --verbose

Rust

Rust is used to tune performance. We use pyo3 as the bindings between Python and Rust.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Build the docker images

make build

This command will build zetsubou/app:0.0.1-python-3.8.16-slim-buster and zetsubou/airflow:2.6.1-python3.8 docker images.

Install the Python packages

We use poetry to organize the Python packages .

poetry install

The pre-commit is used to hook the formatters and validators.

pre-commit install

Build frontend

cd front
npm install --also=dev
npm run build
cd ..

Build documentation

Create the static docs files in ./front/doc_site.

make docs

Run

Create the volumes under ./dev relative to the current working directory, initialize the Airflow, and generate ./etc/settings.env and ./etc/settings.airflow.env settings files.

make init-example

Start the services with Docker containers except the ZetsuBou web application.

make up-dev

Run the ZetsuBou web application in Python CLI.

python cli.py run
poetry run python cli.py run

Or you can run app.py directly if you need to.

python app.py
poetry run python app.py

Run before you push the codes

You should run the following command for every commit or you can run the commands manually.

make lint
# To format the files
pre-commit run --all-files
# To check the commit format. This command checks only one commit. If you want to
# check multiple commits, you can change the number in `HEAD~1`.
npx commitlint --from "HEAD~1" --to "HEAD" --verbose
Extensions Description
bradlc.vscode-tailwindcss For Tailwindcss autocomplete.
ms-python.isort To automatically sort the Python import.
redhat.vscode-yaml For yaml autocomplete, e.g. mkdocs.yml.

Last update: August 12, 2023