Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,33 @@ make reqs-upgrade
> Remember that if you change the [requirements.txt],
you need to rebuild the docker image (`make docker-build`) in order to use it locally.

### Using UV for faster local development (Optional)

**This is for local development only.** Docker builds use pip by default.

If you prefer faster dependency resolution and installation during local development,
you can optionally use [uv](https://docs.astral.sh/uv/) instead of pip.

Install `uv`:
```shell
curl -LsSf https://astral.sh/uv/install.sh | sh
```

Then, use it with the justfile commands:

```
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation mentions using the justfile but doesn't explain what just is or how to install it. Users unfamiliar with the just command runner won't know how to use this feature. Consider adding a brief explanation and installation instructions for just (e.g., the command runner tool that executes justfile recipes).

Suggested change
```
`just` is a simple command runner that executes recipes defined in a `justfile`.
If you don't have it installed, follow the instructions for your platform, for example:
- macOS (Homebrew): `brew install just`
- Debian/Ubuntu: `sudo apt-get install just`
- Other platforms and installation options: see the official docs at https://github.com/casey/just#installation
Once `just` is installed, you can run:
```shell

Copilot uses AI. Check for mistakes.
just install
```

Or use the Makefile commands while overriding the `PIP` variable:

```shell
make install PIP="uv pip"
```
Comment on lines +153 to +157
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation claims that the Makefile can accept a PIP variable override, but the Makefile doesn't actually use a PIP variable - it hardcodes python -m pip commands. This documentation is misleading and the example won't work as described unless the Makefile is updated to support PYTHON and PIP variables.

Copilot uses AI. Check for mistakes.

This will use `uv pip` for faster resolution while maintaining the same functionality.
Docker and CI/CD pipelines will continue to use standard pip.

## Git Workflow

<div align="justify">
Expand Down Expand Up @@ -170,7 +197,7 @@ Try to follow these guidelines:

- Maintain a clean commit history in your feature branch.
Use interactive rebase (`git rebase -i`) to squash, reorder, or edit commits.[^1]

- If you are not using [pre-commit] hooks,
use the provided [Makefile] commands (`format`, `lint`, `codespell`, `typecheck`)
as much as possible to maintain code quality.
Expand All @@ -195,8 +222,8 @@ Try to follow these guidelines:

<div align="justify">

A Google Cloud build that publishes a Docker image is triggered in the following cases:
- When a commit is merged into `main` or `develop`.
A Google Cloud build that publishes a Docker image is triggered in the following cases:
- When a commit is merged into `main` or `develop`.
- When a new tag is created.


Expand Down
97 changes: 97 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Justfile - Thin wrapper for local development
# Adjusts PYTHON and PIP variables for venv, then calls Make recipes
# Use: `just install`, `just test`, `just reqs`, etc.

set shell := ["bash", "-c"]


VENV_NAME := ".venv"
PYTHON := VENV_NAME / "bin" / "python"
PIP := "uv pip"
Comment on lines +8 to +10
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The justfile passes PYTHON and PIP variables to make commands, but the Makefile doesn't actually accept or use these variables. The Makefile hardcodes python -m pip and python -m in all its recipes. This means the justfile won't achieve its intended purpose of using UV for faster local development. The Makefile needs to be updated to use PYTHON and PIP variables (e.g., $(PYTHON) -m pip instead of python -m pip) for this integration to work.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PIP variable is hardcoded to "uv pip" instead of being configurable. This forces all users who use the justfile to install UV, making it not truly optional. Consider using a default that falls back to standard pip if UV is not available, or making this configurable through an environment variable. For example: PIP := env_var_or_default('PIP', 'python -m pip')

Suggested change
PIP := "uv pip"
PIP := env_var_or_default('PIP', 'python -m pip')

Copilot uses AI. Check for mistakes.

[private]
default:
just --list

# Create virtual environment
venv:
make venv
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The venv recipe doesn't pass the PYTHON variable to make, unlike other recipes. While this is currently correct since the Makefile's venv target doesn't accept variables, it creates inconsistency. If UV is intended to be used for virtual environment creation (which UV can do faster), this should be handled differently or documented as a limitation.

Suggested change
make venv
make venv PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

Copilot uses AI. Check for mistakes.

# Upgrade pip
upgrade-pip:
make upgrade-pip PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Install only test dependencies
install-test: upgrade-pip
make install-test PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Install the package in editable mode & all dependencies for local development
install: upgrade-pip
make install PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Run all unit tests exporting coverage.xml report
test:
make test PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Install and pre-commit hooks
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the comment. Should be "Install pre-commit hooks" instead of "Install and pre-commit hooks".

Suggested change
# Install and pre-commit hooks
# Install pre-commit hooks

Copilot uses AI. Check for mistakes.
hooks:
make hooks PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Auto-format python source files according with PEP8
format:
make format PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Lint python source files
lint:
make lint PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Use Codespell to do spell checking
codespell:
make codespell PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Perform type-checking
typecheck:
make typecheck PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Use pip-audit to scan for known vulnerabilities
audit:
make audit PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Run all pre-commit hooks
pre-commit:
make pre-commit PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Run the standard set of checks performed in CI
all: lint codespell typecheck audit test

# Compile requirements.txt with pip-tools
reqs:
make reqs PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"

# Upgrade requirements.txt with pip-tools
reqs-upgrade:
make reqs-upgrade PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"
Comment on lines +69 to +73
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The justfile passes PYTHON and PIP variables to the reqs make target, but the Makefile's reqs target uses Docker and doesn't accept or use these variables. This creates a misleading interface where users might expect UV to be used for requirements compilation, but Docker with standard pip is always used instead.

Suggested change
make reqs PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"
# Upgrade requirements.txt with pip-tools
reqs-upgrade:
make reqs-upgrade PYTHON="{{ PYTHON }}" PIP="{{ PIP }}"
make reqs
# Upgrade requirements.txt with pip-tools
reqs-upgrade:
make reqs-upgrade

Copilot uses AI. Check for mistakes.

# Docker: Build docker images
docker-build:
make docker-build

# Docker: Create the docker volume for GCP
docker-volume:
make docker-volume

# Docker: Authenticate to google cloud and configure the project
docker-gcp:
make docker-gcp

# Docker: Run tests using prod image, exporting coverage.xml report
docker-ci-test:
make docker-ci-test

# Docker: Enter interactive dev container shell
docker-shell:
make docker-shell

# Clean local caches and build artifacts
clean:
make clean
Loading