This document is intended for software engineers and translators who would like to help out with the development of Cozy, or simply be able to run bleeding edge versions of the code locally.
To ensure good quality code, we lint our codebase with Ruff. We recommend that you run Ruff before pushing your changes to GitHub and correct the warnings, otherwise the automatic checks on pull requests will fail.
ruff check <filename>
For consistent code style, we format the source files using black and isort. Run these two tools on the changed files before committing.
black cozy
isort cozy
You can install these tools via pip:
pip install black isort ruff
We recommend using GNOME Builder to build and run Cozy.
- Open GNOME Builder
- Click the Clone Repository button
- Enter
https://github.com/geigi/cozy.gitin the Repository URL field - Click the Clone Project button
- Click the
▶️ Run button to start building the application
The below instructions have been tested on Ubuntu 20.04 and Fedora 39
sudo apt update
sudo apt install \
appstreamcli \
cmake \
gettext \
git \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
libgirepository1.0-dev \
libgstreamer1.0-0 \
libgtk-4-dev \
libadwaita-1-dev \
pip \
python-gi-cairo \
python3-gst-1.0 \
python3-venvsudo dnf install \
appstream \
cmake \
gettext \
gstreamer1-libav \
gstreamer1-plugins-ugly \
gstreamer1-plugins-bad \
gstreamer1-plugins-good \
gstreamer1-devel\
gtk4-devel \
libadwaita-devel \
pipenv \
python3-cairo-devel \
python3-gstreamer1git clone https://github.com/geigi/cozy.git
cd cozyTip
It is generally a good idea to set up a virtual environment for Python projects. It creates an isolated environment where packages can be installed without creating conflicts with other packages installed system-wide.
python3 -m venv venv
source ./venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install meson ninja
pip install pytest pytest-mockTo enter the virtual environment, you will need to run source ./venv/bin/activate every time you reopen your terminal.
Let's assume you wish to build the application under the build/ directory and install the binaries under app/:
meson setup --prefix=$(pwd)/app ./build
ninja -C build installninja -C build com.github.geigi.cozy-update-po
ninja -C build extra-update-poXDG_DATA_DIRS=app/share:/usr/share \
PYTHONPATH=app/lib/python3.11/site-packages \
app/bin/com.github.geigi.cozyYour Python path may be different so you might need to amend the PYTHONPATH environment variable above in case of errors.
Note
Every time you make changes to the code, you need to execute ninja -C build install before you run the application.
python -m pytest