From 2f64f0c7e73e9c28474786ec9d4600c773fae3e1 Mon Sep 17 00:00:00 2001 From: Nikolas Nyby Date: Fri, 3 Nov 2023 13:44:27 -0400 Subject: [PATCH] Update makefiles --- django.mk | 53 +++++++++++------------------------------------------ js.mk | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 44 deletions(-) diff --git a/django.mk b/django.mk index 7b2b10f43..5c1b1f935 100644 --- a/django.mk +++ b/django.mk @@ -1,10 +1,11 @@ -# VERSION=1.8.0 +# VERSION=1.9.0 # CHANGES: # 1.9.0 - Use coverage tool directly to generate coverage # reports. # - wheel and pip updates # - Use pre-compiled binary wheel for cryptography +# - Remove Travis references # 1.8.0 - 2019-10-21 - Don't run flake8 on local_settings.py # 1.7.0 - 2018-05-31 - Now using python 3 by default # - Removed virtualenv.py in favor of python 3's @@ -22,28 +23,18 @@ MANAGE ?= ./manage.py REQUIREMENTS ?= requirements.txt SYS_PYTHON ?= python3 PY_SENTINAL ?= $(VE)/sentinal -WHEEL_VERSION ?= 0.36.2 -PIP_VERSION ?= 21.0.1 +WHEEL_VERSION ?= 0.41.2 +PIP_VERSION ?= 23.2.1 MAX_COMPLEXITY ?= 10 INTERFACE ?= localhost RUNSERVER_PORT ?= 8000 PY_DIRS ?= $(APP) +BANDIT ?= $(VE)/bin/bandit +FLAKE8 ?= $(VE)/bin/flake8 +PIP ?= $(VE)/bin/pip +COVERAGE ?= $(VE)/bin/coverage -# Travis has issues here. See: -# https://github.com/travis-ci/travis-ci/issues/9524 -ifeq ($(TRAVIS),true) - BANDIT ?= bandit - FLAKE8 ?= flake8 - PIP ?= pip - COVERAGE ?= coverage -else - BANDIT ?= $(VE)/bin/bandit - FLAKE8 ?= $(VE)/bin/flake8 - PIP ?= $(VE)/bin/pip - COVERAGE ?= $(VE)/bin/coverage -endif - -jenkins: check flake8 test eslint bandit +jenkins: check flake8 test bandit $(PY_SENTINAL): $(REQUIREMENTS) rm -rf $(VE) @@ -55,7 +46,7 @@ $(PY_SENTINAL): $(REQUIREMENTS) touch $@ test: $(PY_SENTINAL) - $(COVERAGE) run --source='.' --omit=$(VE)/* $(MANAGE) test $(APP) + $(COVERAGE) run --source='.' --omit=$(VE)/* $(MANAGE) test $(PY_DIRS) $(COVERAGE) xml -o reports/coverage.xml parallel-tests: $(PY_SENTINAL) @@ -88,26 +79,4 @@ clean: rm -rf node_modules find . -name '*.pyc' -exec rm {} \; -pull: - git pull - make check - make test - make migrate - make flake8 - -rebase: - git pull --rebase - make check - make test - make migrate - make flake8 - -# run this one the very first time you check -# this out on a new machine to set up dev -# database, etc. You probably *DON'T* want -# to run it after that, though. -install: jenkins - createdb $(APP) - make migrate - -.PHONY: jenkins test flake8 runserver migrate check shell clean pull rebase install +.PHONY: jenkins test flake8 runserver migrate check shell clean diff --git a/js.mk b/js.mk index 832d61077..20d928ca8 100644 --- a/js.mk +++ b/js.mk @@ -1,6 +1,7 @@ -# VERSION=1.3.0 +# VERSION=1.3.1 # CHANGES: +# 1.3.1 - conditionally install npm deps based on ENVIRONMENT var # 1.3.0 - restore eslint # 1.2.0 - restore jshint/jscs @@ -22,9 +23,18 @@ NODE_MODULES ?= ./node_modules JS_SENTINAL ?= $(NODE_MODULES)/sentinal ESLINT ?= $(NODE_MODULES)/.bin/eslint +NPM_OPTS = --include=dev + +ifeq ($(ENVIRONMENT),production) + NPM_OPTS = --only=prod +endif +ifeq ($(ENVIRONMENT),staging) + NPM_OPTS = --only=prod +endif + $(JS_SENTINAL): package.json rm -rf $(NODE_MODULES) - npm install + npm install $(NPM_OPTS) touch $(JS_SENTINAL) eslint: $(JS_SENTINAL)