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

Update makefiles #2487

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
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
53 changes: 11 additions & 42 deletions django.mk
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
14 changes: 12 additions & 2 deletions js.mk
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down
Loading