Skip to content

Commit

Permalink
Update Makefile to check for uv pip
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson committed Oct 1, 2024
1 parent 74fa6a9 commit 835d247
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ DOCKER = $(shell which docker)
TEST_DOMAIN = www.mozilla.org
POCKET_MODE = Pocket

# Check if 'uv' exists and set the command accordingly
ifneq (, $(shell which uv 2>/dev/null))
pip = uv pip
else
pip = pip
endif

all: help

help:
Expand Down Expand Up @@ -164,7 +171,7 @@ compile-requirements: .docker-build-pull
${DC} run --rm compile-requirements

check-requirements: .docker-build-pull
${DC} run --rm test pip list -o
${DC} run --rm app ./bin/check-pinned-requirements.py

######################################################
# For use in local-machine development (not in Docker)
Expand All @@ -184,8 +191,8 @@ install-local-python-deps:
# Dev requirements are a superset of prod requirements, but we install
# them in the same separate steps that we use for our Docker-based build,
# so that it mirrors Production and Dev image building
pip install -r requirements/prod.txt
pip install -r requirements/dev.txt
$(pip) install -r requirements/prod.txt
$(pip) install -r requirements/dev.txt

run-local-task-queue:
# We temporarily source the .env for the command's duration only
Expand All @@ -195,7 +202,7 @@ run-local-task-queue:


clean-local-deps:
pip uninstall mdx_outline -y && pip freeze | xargs pip uninstall -y
$(pip) uninstall mdx_outline -y && $(pip) freeze | xargs $(pip) uninstall -y

# Done explicitly to avoid surprises
install-custom-git-hooks:
Expand Down

0 comments on commit 835d247

Please sign in to comment.