From 4ea46f2c71c754f9907038a62b3e36c58d3a9d5f Mon Sep 17 00:00:00 2001 From: David McDonald Date: Thu, 19 Dec 2019 16:25:01 +0000 Subject: [PATCH 1/3] Remove pip-accel Not sure how much benefit we are getting from this. Pip-accel has already not been supported for 3 years now either. --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 4f88bbc84..10ad26c7c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ SHELL := /bin/bash DATE = $(shell date +%Y-%m-%dT%H:%M:%S) -PIP_ACCEL_CACHE ?= ${CURDIR}/cache/pip-accel APP_VERSION_FILE = app/version.py GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached") @@ -37,7 +36,7 @@ venv: venv/bin/activate ## Create virtualenv if it does not exist venv/bin/activate: test -d venv || virtualenv venv -p python3 - . venv/bin/activate && pip install pip-accel + . venv/bin/activate .PHONY: check-env-vars check-env-vars: ## Check mandatory environment variables @@ -73,8 +72,7 @@ dependencies: venv ## Install build dependencies npm set progress=false npm install npm rebuild node-sass - mkdir -p ${PIP_ACCEL_CACHE} - . venv/bin/activate && PIP_ACCEL_CACHE=${PIP_ACCEL_CACHE} pip-accel install -r requirements_for_test.txt + . venv/bin/activate && pip install -r requirements_for_test.txt .PHONY: generate-version-file generate-version-file: ## Generates the app version file @@ -83,7 +81,7 @@ generate-version-file: ## Generates the app version file .PHONY: build build: dependencies generate-version-file ## Build project npm run build - . venv/bin/activate && PIP_ACCEL_CACHE=${PIP_ACCEL_CACHE} pip-accel install -r requirements.txt + . venv/bin/activate && pip install -r requirements.txt .PHONY: build-paas-artifact build-paas-artifact: ## Build the deploy artifact for PaaS @@ -130,14 +128,12 @@ coverage: venv ## Create coverage report .PHONY: prepare-docker-build-image prepare-docker-build-image: ## Prepare the Docker builder image - mkdir -p ${PIP_ACCEL_CACHE} make -C docker build define run_docker_container @docker run -i${DOCKER_TTY} --rm \ --name "${DOCKER_CONTAINER_PREFIX}-${1}" \ -v "`pwd`:/var/project" \ - -v "${PIP_ACCEL_CACHE}:/var/project/cache/pip-accel" \ -e UID=$(shell id -u) \ -e GID=$(shell id -g) \ -e GIT_COMMIT=${GIT_COMMIT} \ From 4c9c98afb498904c28068a7f7c46562fdcb185bb Mon Sep 17 00:00:00 2001 From: David McDonald Date: Fri, 20 Dec 2019 16:57:25 +0000 Subject: [PATCH 2/3] Remove forcing of venv Let's developers do this themselves using virtualenvwrapper --- Makefile | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 10ad26c7c..ac1674270 100644 --- a/Makefile +++ b/Makefile @@ -31,13 +31,6 @@ NOTIFY_CREDENTIALS ?= ~/.notify-credentials help: @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -.PHONY: venv -venv: venv/bin/activate ## Create virtualenv if it does not exist - -venv/bin/activate: - test -d venv || virtualenv venv -p python3 - . venv/bin/activate - .PHONY: check-env-vars check-env-vars: ## Check mandatory environment variables $(if ${DEPLOY_ENV},,$(error Must specify DEPLOY_ENV)) @@ -68,11 +61,11 @@ production: ## Set environment to production @true .PHONY: dependencies -dependencies: venv ## Install build dependencies +dependencies: ## Install build dependencies npm set progress=false npm install npm rebuild node-sass - . venv/bin/activate && pip install -r requirements_for_test.txt + pip install -r requirements_for_test.txt .PHONY: generate-version-file generate-version-file: ## Generates the app version file @@ -81,7 +74,7 @@ generate-version-file: ## Generates the app version file .PHONY: build build: dependencies generate-version-file ## Build project npm run build - . venv/bin/activate && pip install -r requirements.txt + pip install -r requirements.txt .PHONY: build-paas-artifact build-paas-artifact: ## Build the deploy artifact for PaaS @@ -100,7 +93,7 @@ upload-static: aws s3 cp --region eu-west-1 --recursive --cache-control max-age=315360000,immutable ./app/static s3://${DNS_NAME}-static .PHONY: test -test: venv ## Run tests +test: ## Run tests ./scripts/run_tests.sh .PHONY: freeze-requirements @@ -123,8 +116,8 @@ test-requirements: || { echo "requirements.txt is up to date"; exit 0; } .PHONY: coverage -coverage: venv ## Create coverage report - . venv/bin/activate && coveralls +coverage: ## Create coverage report + coveralls .PHONY: prepare-docker-build-image prepare-docker-build-image: ## Prepare the Docker builder image @@ -179,7 +172,7 @@ clean-docker-containers: ## Clean up any remaining docker containers .PHONY: clean clean: - rm -rf node_modules cache target venv .coverage + rm -rf node_modules cache target .coverage .PHONY: cf-login cf-login: ## Log in to Cloud Foundry From 807c83c65696246ae7f103d0cfad59f5ef1a5d0f Mon Sep 17 00:00:00 2001 From: David McDonald Date: Fri, 20 Dec 2019 16:58:45 +0000 Subject: [PATCH 3/3] Remove coveralls We don't use it --- Makefile | 12 +----------- requirements_for_test.txt | 1 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Makefile b/Makefile index ac1674270..6b519d1e2 100644 --- a/Makefile +++ b/Makefile @@ -115,10 +115,6 @@ test-requirements: echo "Run 'make freeze-requirements' to update."; exit 1; } \ || { echo "requirements.txt is up to date"; exit 0; } -.PHONY: coverage -coverage: ## Create coverage report - coveralls - .PHONY: prepare-docker-build-image prepare-docker-build-image: ## Prepare the Docker builder image make -C docker build @@ -137,7 +133,6 @@ define run_docker_container -e https_proxy="${HTTPS_PROXY}" \ -e HTTPS_PROXY="${HTTPS_PROXY}" \ -e NO_PROXY="${NO_PROXY}" \ - -e COVERALLS_REPO_TOKEN=${COVERALLS_REPO_TOKEN} \ -e CIRCLECI=1 \ -e CI_NAME=${CI_NAME} \ -e CI_BUILD_NUMBER=${BUILD_NUMBER} \ @@ -161,18 +156,13 @@ build-with-docker: prepare-docker-build-image ## Build inside a Docker container test-with-docker: prepare-docker-build-image ## Run tests inside a Docker container $(call run_docker_container,test,gosu hostuser make test) -# FIXME: CIRCLECI=1 is an ugly hack because the coveralls-python library sends the PR link only this way -.PHONY: coverage-with-docker -coverage-with-docker: prepare-docker-build-image ## Generates coverage report inside a Docker container - $(call run_docker_container,coverage,gosu hostuser make coverage) - .PHONY: clean-docker-containers clean-docker-containers: ## Clean up any remaining docker containers docker rm -f $(shell docker ps -q -f "name=${DOCKER_CONTAINER_PREFIX}") 2> /dev/null || true .PHONY: clean clean: - rm -rf node_modules cache target .coverage + rm -rf node_modules cache target .PHONY: cf-login cf-login: ## Log in to Cloud Foundry diff --git a/requirements_for_test.txt b/requirements_for_test.txt index 1aafde244..2f7e7d9e6 100644 --- a/requirements_for_test.txt +++ b/requirements_for_test.txt @@ -5,7 +5,6 @@ pytest-env==0.6.2 pytest-cov==2.8.1 pytest-mock==1.11.2 pytest-xdist==1.27.0 # pyup: <1.28.0 -coveralls==1.8.2 beautifulsoup4==4.8.1 freezegun==0.3.12 flake8==3.7.9