Refs #74 - Removing zc.buildout for DEV/TEST environments. WORK IN PROGRESS.

This commit is contained in:
Benoît Bryon 2014-01-24 15:26:16 +01:00
parent e28951d0a1
commit 2962b84135
4 changed files with 28 additions and 105 deletions

View file

@ -2,22 +2,14 @@
# See INSTALL and docs/dev.txt for details.
SHELL = /bin/bash
ROOT_DIR = $(shell pwd)
BIN_DIR = $(ROOT_DIR)/bin
DATA_DIR = $(ROOT_DIR)/var
VIRTUALENV_DIR = $(ROOT_DIR)/lib/virtualenv
PIP = $(VIRTUALENV_DIR)/bin/pip
BIN_DIR = $(VIRTUALENV_DIR)/bin
PIP = $(BIN_DIR)/pip
WGET = wget
PYTHON = $(VIRTUALENV_DIR)/bin/python
PYTHON = $(BIN_DIR)/python
PROJECT = $(shell $(PYTHON) -c "import setup; print setup.NAME")
PACKAGE = $(shell $(PYTHON) -c "import setup; print setup.PACKAGES[0]")
BUILDOUT_CFG = $(ROOT_DIR)/etc/buildout.cfg
BUILDOUT_DIR = $(ROOT_DIR)/lib/buildout
BUILDOUT_VERSION = 2.2.1
BUILDOUT_BOOTSTRAP_URL = https://raw.github.com/buildout/buildout/$(BUILDOUT_VERSION)/bootstrap/bootstrap.py
BUILDOUT_BOOTSTRAP = $(BUILDOUT_DIR)/bootstrap.py
BUILDOUT_BOOTSTRAP_ARGS = -c $(BUILDOUT_CFG) --version=$(BUILDOUT_VERSION) buildout:directory=$(ROOT_DIR)
BUILDOUT = $(BIN_DIR)/buildout
BUILDOUT_ARGS = -N -c $(BUILDOUT_CFG) buildout:directory=$(ROOT_DIR)
NOSE = $(BIN_DIR)/nosetests
@ -25,18 +17,22 @@ configure:
# Configuration is stored in etc/ folder. Not generated yet.
develop: buildout
develop: directories pip
virtualenv:
if [ ! -d $(VIRTUALENV_DIR)/bin/ ]; then virtualenv --no-site-packages $(VIRTUALENV_DIR); fi
$(PIP) install -r $(ROOT_DIR)/etc/virtualenv.cfg
buildout: virtualenv
if [ ! -d $(BUILDOUT_DIR) ]; then mkdir -p $(BUILDOUT_DIR); fi
if [ ! -f $(BUILDOUT_BOOTSTRAP) ]; then wget -O $(BUILDOUT_BOOTSTRAP) $(BUILDOUT_BOOTSTRAP_URL); fi
if [ ! -x $(BUILDOUT) ]; then $(PYTHON) $(BUILDOUT_BOOTSTRAP) $(BUILDOUT_BOOTSTRAP_ARGS); fi
$(BUILDOUT) $(BUILDOUT_ARGS)
pip: virtualenv
$(PIP) install -r etc/ci-requirements.txt
directories:
mkdir -p var/docs
mkdir -p docs/_static
mkdir -p var/test
clean:
@ -58,7 +54,7 @@ test: test-app test-demo test-documentation
test-app:
$(NOSE) -c $(ROOT_DIR)/etc/nose/base.cfg -c $(ROOT_DIR)/etc/nose/$(PACKAGE).cfg
$(BIN_DIR)/demo test --nose-verbosity=2 -c $(ROOT_DIR)/etc/nose/base.cfg -c $(ROOT_DIR)/etc/nose/$(PACKAGE).cfg django_downloadview
mv $(ROOT_DIR)/.coverage $(ROOT_DIR)/var/test/app.coverage
@ -87,6 +83,7 @@ demo: develop
cp -r $(ROOT_DIR)/demo/demoproject/fixtures var/media/nginx
$(BIN_DIR)/demo loaddata demo.json
runserver: demo
$(BIN_DIR)/demo runserver

View file

@ -4,8 +4,10 @@ import sys
from django.core.management import execute_from_command_line
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "%s.settings" % __package__)
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"{package}.settings".format(package=__package__))
execute_from_command_line(sys.argv)

View file

@ -1,86 +0,0 @@
# Buildout configuration file to deploy a development environment.
[buildout]
# Version management.
show-picked-versions = true
# Configure directories: put buildout generated files in lib/buildout instead
# of in current directory.
bin-directory = bin
develop-eggs-directory = lib/buildout/develop-eggs
eggs-directory = lib/buildout/eggs
installed = lib/buildout/.installed.cfg
parts-directory = lib/buildout/parts
# Package index, mirrors, allowed hosts and dependency links. Those options
# control locations where buildout looks for packages.
index = https://simple.crate.io
find-links =
allow-hosts =
*.crate.io
packages.crate-cdn.com
use-dependency-links = false
# Development.
develop =
${buildout:directory}/
${buildout:directory}/demo/
parts =
scripts
directories
releaser
activate
omelette
[scripts]
recipe = zc.recipe.egg
eggs =
django-downloadview-demo
mock
bpython
nose
rednose
coverage
sphinx
sphinxcontrib-testbuild
initialization =
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'demoproject.settings'
[directories]
recipe = z3c.recipe.mkdir
paths =
var/docs
docs/_static
var/test
[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser
[activate]
recipe = evg.recipe.activate
[omelette]
recipe = collective.recipe.omelette
eggs = ${scripts:eggs}
location = ${buildout:directory}/lib/omelette
[versions]
bpython = 0.12
collective.recipe.omelette = 0.16
coverage = 3.7
Django = 1.6
django-nose = 1.2
docutils = 0.11
evg.recipe.activate = 0.5
Jinja2 = 2.7.1
MarkupSafe = 0.18
mock = 1.0.1
nose = 1.3.0
Pygments = 1.6
python-termstyle = 0.1.10
rednose = 0.4.1
requests = 2.0.1
Sphinx = 1.1.3
sphinxcontrib-testbuild = 0.1.3
z3c.recipe.mkdir = 0.6
zc.recipe.egg = 2.0.1
zest.releaser = 3.48

10
etc/ci-requirements.txt Normal file
View file

@ -0,0 +1,10 @@
coverage
docutils
-e ./
-e ./demo/
mock
nose
rednose
Sphinx
sphinxcontrib-testbuild
zest.releaser