From c741d3585df1c35ff52c4da2a8779e36d36057e1 Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Sat, 21 Mar 2015 17:01:31 -0300 Subject: [PATCH] Added makefile --- .travis.yml | 22 ++++------------------ Makefile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 -- tests/settings.py | 9 --------- 4 files changed, 52 insertions(+), 29 deletions(-) create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml index d6132d8..931ab5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,14 @@ language: python -cache: apt - python: - "2.7" -env: - global: - - DJANGO_SETTINGS_MODULE=tests.settings - - COLAB_SETTINGS=tests/settings.yaml - install: - - pip install coveralls flake8 - - pip install . - - psql -c "CREATE USER colab WITH PASSWORD 'colab' CREATEDB;" -U postgres - -before_script: - - colab-admin build_solr_schema > /tmp/schema.xml - - cat ci/install_solr.sh | SOLR_VERSION=4.10.3 SOLR_CONFS="/tmp/schema.xml" bash + - make travis_install script: - - python setup.py test - - flake8 colab + - make test after_success: - - coveralls - - ci/build_rpm.sh + - make coveralls + - make rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..55eb354 --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ + +VIRTUALENV_PATH = /tmp/colab-venv +PATH := $(VIRTUALENV_PATH)/bin:${PATH} + +DJANGO_SETTINGS_MODULE = tests.settings +export DJANGO_SETTINGS_MODULE +COLAB_SETTINGS = tests/settings.yaml +export COLAB_SETTINGS + +ifndef RELEASE + RELEASE = 1 +endif + +all: + echo $(RELEASE) + +install: + virtualenv $(VIRTUALENV_PATH) + pip install . + virtualenv --relocatable $(VIRTUALENV_PATH) + +test_install: install_solr + pip install flake8 + +install_solr: + # Install java + which apt-get && sudo apt-get install default-jre -y || echo # deb + which yum && sudo yum install java -y || echo # rpm + + colab-admin build_solr_schema > /tmp/schema.xml + SOLR_VERSION=4.10.3 SOLR_CONFS="/tmp/schema.xml" ci/install_solr.sh + +travis_install: test_install + psql -c "CREATE USER colab WITH PASSWORD 'colab' CREATEDB;" -U postgres + +test: + python setup.py test + flake8 colab + +coveralls: + pip install coveralls + coveralls + +rpm: + ci/build_rpm.sh + +clean: + $(RM) -r $(VIRTUALENV_PATH) diff --git a/setup.py b/setup.py index 271ece4..ba1ab93 100644 --- a/setup.py +++ b/setup.py @@ -54,8 +54,6 @@ REQUIREMENTS = [ TEST_REQUIREMENTS = [ 'coverage==3.7.1', - 'coveralls==0.5', - 'flake8==2.3.0', 'mock==1.0.1', ] diff --git a/tests/settings.py b/tests/settings.py index d7670d2..cd92784 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -28,12 +28,3 @@ LOGGING = { }, }, } - -import os -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', - 'URL': 'http://127.0.0.1:8983/solr' - }, -} - -- libgit2 0.21.2