Skip to content

Add a top-level Makefile in python-sdk to simplify running tests and linters #240

@SoulPancake

Description

@SoulPancake

Checklist

Describe the problem you'd like to have solved

Currently, contributors need to look into CI workflows or the generator scripts to figure out how to correctly run tests and linters for the Python SDK.
Since the SDK uses uv, pytest, and ruff, having a local Makefile that mirrors the CI setup (without Docker) would simplify local development.

This also ensures parity between local and CI environments, making contributor onboarding and testing smoother and consistent across SDKs.

Describe the ideal solution

Add a Makefile at the root of python-sdk with the same targets used in the generator’s test-client-python flow — but adapted for local runs.

Example:

.PHONY: test lint fmt sync

# Sync dependencies using uv
sync:
	uv sync

# Run all tests with coverage
test:
	uv run pytest --cov-report term-missing --cov=openfga_sdk test/

# Lint with ruff
lint:
	uv run ruff check .

# Format code with ruff
fmt:
	uv run ruff format .

This enables consistent local development commands:

make sync   # install dependencies
make test   # run tests with coverage
make lint   # run ruff lint checks
make fmt    # format using ruff

Alternatives and current workarounds

Contributors currently inspect CI workflows or replicate Docker commands manually to test locally, which is error-prone and inconsistent.

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions