From 0c59109c5277ed5bf5a9354a327572c8dff554c8 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Tue, 12 Nov 2024 13:36:10 -0500 Subject: [PATCH] fix: add install-build-deps target --- Makefile | 12 ++++++++++++ common.mk | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1dc3d4c..3e9d9e5 100644 --- a/Makefile +++ b/Makefile @@ -24,3 +24,15 @@ publish: publish-pypi ## Publish packages .PHONY: publish-pypi publish-pypi: clean package-pip lint-twine ##- Publish Python packages to pypi uv tool run twine upload dist/* + +# Used for installing build dependencies in CI. +.PHONY: install-build-deps +install-build-deps: +ifeq ($(shell which apt),) + $(warning Cannot install build dependencies without apt.) + $(warning Cannot install build dependencies on non-linux platforms.) +else ifeq ($(wildcard /usr/include/libxml2/libxml/xpath.h),) + sudo apt install libxml2-dev libxslt1-dev +else ifeq ($(wildcard /usr/include/libxslt/xslt.h),) + sudo apt install libxslt1-dev +endif diff --git a/common.mk b/common.mk index f8bbd19..f4184ec 100644 --- a/common.mk +++ b/common.mk @@ -37,7 +37,7 @@ setup: install-uv setup-precommit ## Set up a development environment uv sync --frozen --all-extras .PHONY: setup-tests -setup-tests: install-uv ##- Set up a testing environment without linters +setup-tests: install-uv install-build-deps ##- Set up a testing environment without linters uv sync --frozen .PHONY: setup-lint