Skip to content
Merged
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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: pre-commit hooks
run: env SKIP=test make pre-commit
- name: tests
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.pyc
*.swp
/.env
/.poetry
/.uv
/.venv
/.pytest_cache
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
31 changes: 14 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
export POETRY_HOME=$(CURDIR)/.poetry
# https://github.com/python-poetry/poetry/issues/1917
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
UV_SYSTEM:=$(shell command -v uv 2>/dev/null)
UV_BIN:=$(if $(UV_SYSTEM),$(UV_SYSTEM),$(CURDIR)/.uv/uv)
UV_VENV:=$(CURDIR)/.venv
UV_DEPS:=$(UV_VENV)/.deps

POETRY:=$(POETRY_HOME)/bin/poetry
POETRY_DEPS:=$(POETRY_HOME)/.deps
SYS_PYTHON:=$(shell command -v python3 || command -v python || echo .no-python-found)
default: test

help: # with thanks to Ben Rady
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

$(SYS_PYTHON):
@echo Could not find a system python
exit 1
$(CURDIR)/.uv/uv:
@echo "Installing uv..."
@mkdir -p $(dir $@)
@curl -LsSf https://astral.sh/uv/install.sh | UV_NO_MODIFY_PATH=1 UV_INSTALL_DIR=$(CURDIR)/.uv sh -s

.PHONY: deps
deps: $(POETRY) $(POETRY_DEPS)
$(POETRY): $(SYS_PYTHON)
curl -sSL https://install.python-poetry.org | $(SYS_PYTHON) - --version 1.8.5
$(POETRY_DEPS): $(POETRY) pyproject.toml poetry.lock
$(POETRY) install
deps: $(UV_BIN) $(UV_DEPS)
$(UV_DEPS): $(UV_BIN) pyproject.toml
$(UV_BIN) sync --no-install-project
@touch $@

.PHONY: pre-commit
pre-commit: deps ## Runs all pre-commit hooks
$(POETRY) run pre-commit run --all-files
$(UV_BIN) run pre-commit run --all-files

.PHONY: install-pre-commit
install-pre-commit: deps ## Install pre-commit hooks
$(POETRY) run pre-commit install
$(UV_BIN) run pre-commit install

.PHONY: test
test: deps ## Runs tests
Expand All @@ -37,4 +34,4 @@ test: deps ## Runs tests

.PHONY: build-yamls
build-yamls: deps ## Builds all the yaml build files
$(POETRY) run python make_builds.py
$(UV_BIN) run python make_builds.py
Loading
Loading