2
Setup
Tirsvad edited this page 2026-11-20 05:16:25 +01:00

English · Dansk · Bahasa Malaysia

Setup

This page shows how to get the project running on your own machine. You need Python 3.13 or newer.

Create the environment

Create a local virtual environment named .venv in the project folder, activate it, and upgrade pip:

python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip

On Linux and macOS, activate it with source .venv/bin/activate instead.

Install the project

python -m pip install -e ".[dev]"

The command reads pyproject.toml. Pillow is the only runtime dependency; the dev group adds the test and check tools.

Run the application

With the environment active, start the program from the project folder:

python -m watermark_image

A window opens with an Upload image button. The steps pages explain each control, starting with Step 1.

Run the tests

python -m pytest

What we gained in this step

  • One configuration file. pyproject.toml holds the project name, the Python version it needs, its one runtime dependency and the settings of every tool.
  • A virtual environment. .venv keeps the project's packages apart from the rest of the machine, so the project runs the same everywhere.
  • Tests from the first day. A first test already checks the constants, so the habit of running pytest starts before any feature exists.
  • Constants in one place. constants.py holds every fixed value, so no number is repeated in the code.
  • Documented source. Doxygen comments and a Doxyfile turn the comments into a browsable manual.
  • A quality gate. scripts/check.sh runs tests, linter, type checker and a security scan before every push.