Last active
September 25, 2025 14:12
-
-
Save marcelohmariano/b3bdfe6ffb01486b18d1f20b37cf9c0b to your computer and use it in GitHub Desktop.
Python Makefile for UV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SHELL := /bin/sh | |
| MAKEFLAGS += -Rrs | |
| .ONESHELL: | |
| .SUFFIXES: | |
| python := $(shell which python3) | |
| args = $(filter-out $@,$(MAKECMDGOALS)) | |
| uv := .uv/bin/uv | |
| ruff := $(uv) run ruff | |
| pytest := $(uv) run pytest | |
| pyright := $(uv) run pyright | |
| .PHONY: format lint typecheck test uv | |
| format: $(uv) | |
| $(ruff) format | |
| lint: $(uv) | |
| $(ruff) check | |
| typecheck: $(uv) | |
| $(pyright) | |
| test: $(uv) | |
| $(pytest) | |
| uv: $(uv) | |
| $(uv) $(args) | |
| $(uv): | |
| rm -rf .uv && $(python) -m venv .uv && .uv/bin/pip install uv | |
| %:; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment