mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
Make files - fallback to python(3.8) from PATH if .venv doesn't exist (#4863)
This commit is contained in:
12
Makefile
12
Makefile
@@ -4,6 +4,12 @@ PYTHON ?= python3.8
|
||||
|
||||
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
ifneq ($(wildcard $(ROOT_DIR)/.venv/.),)
|
||||
VENV_PYTHON = $(ROOT_DIR)/.venv/bin/python
|
||||
else
|
||||
VENV_PYTHON = $(PYTHON)
|
||||
endif
|
||||
|
||||
define HELP_BODY
|
||||
Usage:
|
||||
make <command>
|
||||
@@ -25,11 +31,11 @@ export HELP_BODY
|
||||
|
||||
# Python Code Style
|
||||
reformat:
|
||||
$(PYTHON) -m black $(ROOT_DIR)
|
||||
$(VENV_PYTHON) -m black $(ROOT_DIR)
|
||||
stylecheck:
|
||||
$(PYTHON) -m black --check $(ROOT_DIR)
|
||||
$(VENV_PYTHON) -m black --check $(ROOT_DIR)
|
||||
stylediff:
|
||||
$(PYTHON) -m black --check --diff $(ROOT_DIR)
|
||||
$(VENV_PYTHON) -m black --check --diff $(ROOT_DIR)
|
||||
|
||||
# Translations
|
||||
gettext:
|
||||
|
||||
Reference in New Issue
Block a user