Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run project locally

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

uv installed on your machine. You can install it by following the uv installation guide.

  • uv reads the Python version from .python-version (3.11) and downloads it if it is not already installed, so you do not need to install Python separately.

Installation

This guide is for Mac OSX, Linux, or Windows.

  1. Get the source code from the GitHub repository

    $ git clone https://github.com/CenterForTheBuiltEnvironment/clima.git
    $ cd clima
  2. Create a virtual environment and install dependencies:

     uv sync
  3. Run tool locally

Now you should be ready to run the tool locally.

uv run python main.py

Visit http://localhost:8080 in your browser to check it out. uv run uses the project's virtual environment, so you do not need to activate it first.

Adding new dependencies

pyproject.toml lists the dependencies of the project, and uv.lock records the exact version of every package that gets installed.

To add a Python package to the project use the add command. For example,

uv add beautifulsoup4

uv add updates both pyproject.toml and uv.lock. If you edit pyproject.toml by hand, update the lock file with

uv lock

Managing your development environment

There are usually some Python packages that are only required in your development environment and not in your production environment, such as unit testing packages. uv keeps them in a separate dev dependency group using the --dev flag. For example,

uv add --dev nose2

Testing

The tests are end-to-end tests written with pytest and Playwright. CI runs them on every push and pull request to development.

To run them locally:

  • Install the browser Playwright uses (only needed once): uv run playwright install chromium

  • Start the Clima application with uv run python main.py and confirm that http://localhost:8080/ is up.

  • In a second terminal, run the tests:

Versioning

When you release a new version of the tool you should first use bump2version to update the version of the tool. You can use the following command:

bump2version updates the version in pyproject.toml, uv.lock, pages/lib/layout.py and assets/manifest.json, then commits the change and tags it. The settings are in .bumpversion.cfg.

If the above command does not work even if you have committed all the files try with uv run bump2version patch --allow-dirty

Secondly, you should describe the changes in docs/version/changelog.md

Deploy to Google Cloud Run

You need to have gcloud installed on your computer. A short guide on how to deploy on Google Cloud Run can be found here.

First make sure you that:

  • gcloud is up-to-date

  • that you are logged in with the right account

  • you have updated uv.lock (uv lock) and committed it.

First test the application.

Deploy test version manually using gcloud and docker locally - quicker and great to test small changes

Deploy test version of the project

Deploy main version of the project

Last updated

Was this helpful?