From fce9c1f7b5c7973adeb0dea2252a686816af9b58 Mon Sep 17 00:00:00 2001 From: Hoid Date: Fri, 7 Oct 2022 12:17:28 -0400 Subject: [PATCH 1/3] Update Makefile so PYTHONPATH isn't necessary --- .coveragerc | 9 +++++++++ Makefile | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..6deec938 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,9 @@ +[run] +include = + src/** + +omit = + **/__init__.py + **/_version.py + src/dug/config.py + src/dug/hookspecs.py \ No newline at end of file diff --git a/Makefile b/Makefile index 170d70c4..02ab4525 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ PYTHON = /usr/bin/env python3 +PYTHONPATH = $(shell echo ${PWD})/src VERSION_FILE = ./src/dug/_version.py VERSION = $(shell cut -d " " -f 3 ${VERSION_FILE}) DOCKER_REPO = docker.io @@ -27,7 +28,6 @@ clean: install: ${PYTHON} -m pip install --upgrade pip ${PYTHON} -m pip install -r requirements.txt - ${PYTHON} -m pip install . #test: Run all tests test: From cefcdbe796ea0c5bb96cbcfd7941d597f862994b Mon Sep 17 00:00:00 2001 From: Hoid Date: Fri, 7 Oct 2022 12:31:55 -0400 Subject: [PATCH 2/3] Add PYTHONPATH as an exported var in Makefile --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 02ab4525..06ce6726 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ PYTHON = /usr/bin/env python3 -PYTHONPATH = $(shell echo ${PWD})/src VERSION_FILE = ./src/dug/_version.py VERSION = $(shell cut -d " " -f 3 ${VERSION_FILE}) DOCKER_REPO = docker.io @@ -7,6 +6,7 @@ DOCKER_OWNER = helxplatform DOCKER_APP = dug DOCKER_TAG = ${VERSION} DOCKER_IMAGE = ${DOCKER_OWNER}/${DOCKER_APP}:$(DOCKER_TAG) +export PYTHONPATH = $(shell echo ${PWD})/src .DEFAULT_GOAL = help @@ -31,9 +31,13 @@ install: #test: Run all tests test: + echo ${PYTHONPATH} # ${PYTHON} -m flake8 src ${PYTHON} -m pytest --doctest-modules src - ${PYTHON} -m pytest tests + coverage run -m pytest tests + +coverage: + coverage report #build: Build Docker image build: From 2cafe336974dabb1b6e4db13bb51196fd597aba1 Mon Sep 17 00:00:00 2001 From: Hoid Date: Fri, 7 Oct 2022 12:33:46 -0400 Subject: [PATCH 3/3] Remove echo --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 06ce6726..65fa9442 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,6 @@ install: #test: Run all tests test: - echo ${PYTHONPATH} # ${PYTHON} -m flake8 src ${PYTHON} -m pytest --doctest-modules src coverage run -m pytest tests