From 155a919287048c260fe79ea29797e558da695695 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 19 Jun 2016 13:18:32 +0200 Subject: [PATCH] Update Makefile to setup more easily the test env --- Makefile | 15 ++++++++++----- requirements-dev.txt | 1 + requirements.txt | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ad3a01d..e5b19f1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean build install dist test_venv +.PHONY: clean build install dist test_venv test_project VERSION=`python setup.py -V` build: @@ -22,14 +22,15 @@ clean_all: clean_pyc clean_build clean_tox clean_test_venv dist: python setup.py sdist -test_venv: dist +test_venv: mkdir -p test_venv virtualenv test_venv - test_venv/bin/pip install -U django-cas-server -f ./dist/django-cas-server-${VERSION}.tar.gz + test_venv/bin/pip install -U --requirement requirements.txt -test_venv/cas: +test_venv/cas/manage.py: mkdir -p test_venv/cas test_venv/bin/django-admin startproject cas test_venv/cas + ln -s ../../cas_server test_venv/cas/cas_server sed -i "s/'django.contrib.staticfiles',/'django.contrib.staticfiles',\n 'bootstrap3',\n 'cas_server',/" test_venv/cas/cas/settings.py sed -i "s/'django.middleware.clickjacking.XFrameOptionsMiddleware',/'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.locale.LocaleMiddleware',/" test_venv/cas/cas/settings.py sed -i 's/from django.conf.urls import url/from django.conf.urls import url, include/' test_venv/cas/cas/urls.py @@ -37,5 +38,9 @@ test_venv/cas: test_venv/bin/python test_venv/cas/manage.py migrate test_venv/bin/python test_venv/cas/manage.py createsuperuser -run_test_server: test_venv test_venv/cas +test_project: test_venv test_venv/cas/manage.py + @echo "##############################################################" + @echo "A test django project was created in $(realpath test_venv/cas)" + +run_test_server: test_project test_venv/bin/python test_venv/cas/manage.py runserver diff --git a/requirements-dev.txt b/requirements-dev.txt index 9998ce7..8634506 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,4 @@ +Django >= 1.8,<1.10 tox==1.8.1 pytest==2.6.4 pytest-django==2.7.0 diff --git a/requirements.txt b/requirements.txt index 38096e1..8d64df0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +Django >= 1.8,<1.10 setuptools>=5.5 requests>=2.4 requests_futures>=0.9.5