Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix Makefile’s check for goals that require a virtual environment #299

Merged
merged 1 commit into from
Sep 1, 2022
Merged
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
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ SHELL := /usr/bin/env bash

# This variable contains the first goal that matches any of the listed goals
# here, else it contains an empty string. The net effect is to filter out
# whether this current run of `make` requires a Python virtual environment.
# whether this current run of `make` requires a Python virtual environment
# by checking if any of the given goals requires a virtual environment (all
# except the 'venv' and the various 'clean' and 'nuke' goals do). Note that
# checking for 'upgrade' and 'check' goals includes all of their variations.
NEED_VENV := $(or \
$(findstring all,$(MAKECMDGOALS)), \
$(findstring setup,$(MAKECMDGOALS)), \
$(findstring upgrade-quiet,$(MAKECMDGOALS)), \
$(findstring upgrade,$(MAKECMDGOALS)), \
$(findstring requirements,$(MAKECMDGOALS)), \
$(findstring sbom,$(MAKECMDGOALS)), \
$(findstring all,$(MAKECMDGOALS)), \
$(findstring quick-check,$(MAKECMDGOALS)), \
$(findstring requirements,$(MAKECMDGOALS)), \
$(findstring check,$(MAKECMDGOALS)), \
$(findstring test,$(MAKECMDGOALS)), \
$(findstring dist,$(MAKECMDGOALS)), \
$(findstring docs,$(MAKECMDGOALS)) \
$(findstring docs,$(MAKECMDGOALS)), \
$(findstring prune,$(MAKECMDGOALS)), \
)
ifeq ($(NEED_VENV),)
# None of the current goals requires a virtual environment.
Expand Down