~lifeless/python-oops-tools/hostname

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
PYTHON_SRC := $(shell find src -name '*.py' )
PYTHON = python
DBPORT = 5433

# LAZR_SOURCEDEPS_DIR can be set to point to a directory that
# contains a download-cache and eggs directory. If this environment
# variable exist, the download-cache and eggs directories will be
# symlinked, to make initial building faster.
ifdef LAZR_SOURCEDEPS_DIR
	CREATE_EGGS_COMMAND=ln -s $(LAZR_SOURCEDEPS_DIR)/eggs
	CREATE_DOWNLOAD_CACHE_COMMAND=ln -s $(LAZR_SOURCEDEPS_DIR)/download-cache
else
	CREATE_EGGS_COMMAND=mkdir eggs
	CREATE_DOWNLOAD_CACHE_COMMAND=bzr checkout \
    lp:lazr-source-dependencies download-cache
endif

.PHONY: test build lint check clean tags run dbreset harness

build: bin/buildout

bin/buildout: buildout.cfg versions.cfg setup.py download-cache eggs
	bzr up download-cache
	$(PYTHON) bootstrap.py \
		--setup-source=ez_setup.py \
		--download-base=download-cache/dist --eggs=eggs
	bin/buildout configuration:db-port=$(DBPORT)
	@touch bin/buildout

test:
	bin/test

lint:
	pyflakes $(PYTHON_SRC)
	pylint --rcfile=etc/pylintrc $(PYTHON_SRC)

check: clean bin/buildout
	bin/test

eggs:
	$(CREATE_EGGS_COMMAND)

download-cache:
	$(CREATE_DOWNLOAD_CACHE_COMMAND)

clean:
	find . -type f -name '*.py[co]' -exec rm -f {} \;
	rm -f bin/buildout
	rm -f src/oopstools/settings.py
	bzr clean-tree --unknown --force

realclean: clean
	rm -rf download-cache
	rm -rf eggs
	rm -rf develop-eggs

tags:
	bin/tags

run:
	bin/django runserver 8000

dbreset:
	bin/django sqlclear oops | psql -U lpoops -p 5433 && bin/django migrate oops zero

harness:
	bin/django shell

update_db:
	bin/update_db

load_sample_data:
	bin/django migrate && bin/load_sample_data