Module: check_mk
Branch: master
Commit: 2714b95756ba235baa6181b5ddaf2b49122842e6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2714b95756ba23…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu May 24 17:16:49 2018 +0200
Use direnv + pipenv in a more official way.
Change-Id: I5d2464b5de8dc36e8d98ab3f6f9c401d0f8bf608
---
.envrc | 11 ++---------
Makefile | 3 ++-
tests/Makefile | 4 ++--
tests/conftest.py | 2 +-
4 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/.envrc b/.envrc
index 4030cf6..b16459f 100644
--- a/.envrc
+++ b/.envrc
@@ -1,9 +1,2 @@
-# Check_MK config for direnv (Environment switcher for the shell)
-export PIPENV_VENV_IN_PROJECT=true
-
-VENV_DIR=$(pipenv --venv)
-if [ -n "$VENV_DIR" ]; then
- source $VENV_DIR/bin/activate
-else
- echo "Execute \"make setup\" to create the virtual environment"
-fi
+mkdir -p .venv
+layout pipenv
diff --git a/Makefile b/Makefile
index 560bbf4..fe88adb 100644
--- a/Makefile
+++ b/Makefile
@@ -539,7 +539,8 @@ ifeq ($(ENTERPRISE),yes)
endif
.venv: Pipfile Pipfile.lock
- source .envrc ; pipenv install --dev
+ mkdir -p .venv
+ pipenv install --dev
direnv allow
# This dummy rule is called from subdirectories whenever one of the
diff --git a/tests/Makefile b/tests/Makefile
index 2aca780..33ef6ad 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,6 +1,6 @@
SHELL=/bin/bash -e
-PYTEST=source ../.envrc ; py.test -s -vv
-COVERAGE=source ../.envrc ; coverage
+PYTEST=pipenv run py.test -s -vv
+COVERAGE=pipenv run coverage
.PHONY: help test-pylint test-integration test-gui-crawl \
test-bandit test-shellcheck setup format test-mypy \
diff --git a/tests/conftest.py b/tests/conftest.py
index 299e61b..19a880b 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -172,7 +172,7 @@ def verify_virtualenv():
def is_running_in_virtualenv():
- return os.environ.get("VIRTUAL_ENV")
+ return os.environ.get("PIP_PYTHON_PATH")
def is_running_as_site_user():