2014-04-08 17:43:09 +00:00
|
|
|
SYSTEMPYTHON = `which python2 python | head -n 1`
|
|
|
|
VIRTUALENV = virtualenv --python=$(SYSTEMPYTHON)
|
2014-04-16 18:06:09 +00:00
|
|
|
ENV = ./local
|
|
|
|
TOOLS := $(addprefix $(ENV)/bin/,flake8 nosetests)
|
2014-02-06 06:29:34 +00:00
|
|
|
|
2014-05-15 07:51:32 +00:00
|
|
|
# Hackety-hack around OSX system python bustage.
|
|
|
|
# The need for this should go away with a future osx/xcode update.
|
|
|
|
ARCHFLAGS = -Wno-error=unused-command-line-argument-hard-error-in-future
|
|
|
|
INSTALL = ARCHFLAGS=$(ARCHFLAGS) $(ENV)/bin/pip install
|
|
|
|
|
2014-04-16 18:06:09 +00:00
|
|
|
.PHONY: all
|
2014-04-16 19:34:15 +00:00
|
|
|
all: build
|
2014-02-06 06:29:34 +00:00
|
|
|
|
2014-04-16 18:06:09 +00:00
|
|
|
.PHONY: build
|
|
|
|
build: | $(ENV)
|
2014-04-30 05:39:05 +00:00
|
|
|
$(ENV): requirements.txt
|
2014-04-16 18:06:09 +00:00
|
|
|
$(VIRTUALENV) --no-site-packages $(ENV)
|
2014-05-15 07:51:32 +00:00
|
|
|
$(INSTALL) -r requirements.txt
|
2014-04-16 18:06:09 +00:00
|
|
|
$(ENV)/bin/python ./setup.py develop
|
2014-05-01 02:02:41 +00:00
|
|
|
touch $(ENV)
|
2014-02-06 06:29:34 +00:00
|
|
|
|
2014-04-16 18:06:09 +00:00
|
|
|
.PHONY: test
|
|
|
|
test: | $(TOOLS)
|
|
|
|
$(ENV)/bin/flake8 ./syncserver
|
|
|
|
$(ENV)/bin/nosetests -s syncstorage.tests
|
|
|
|
# Tokenserver tests currently broken due to incorrect file paths
|
|
|
|
# $(ENV)/bin/nosetests -s tokenserver.tests
|
|
|
|
|
|
|
|
# Test against a running server
|
|
|
|
$(ENV)/bin/pserve syncserver/tests.ini & SERVER_PID=$$!; \
|
|
|
|
sleep 2; \
|
|
|
|
$(ENV)/bin/python -m syncstorage.tests.functional.test_storage \
|
|
|
|
--use-token-server http://localhost:5000/token/1.0/sync/1.5; \
|
|
|
|
kill $$SERVER_PID
|
2014-02-06 06:29:34 +00:00
|
|
|
|
2014-04-16 18:06:09 +00:00
|
|
|
$(TOOLS): | $(ENV)
|
2014-05-15 07:51:32 +00:00
|
|
|
$(INSTALL) nose flake8
|
2014-02-06 06:29:34 +00:00
|
|
|
|
2014-04-16 18:06:09 +00:00
|
|
|
.PHONY: serve
|
|
|
|
serve: | $(ENV)
|
|
|
|
$(ENV)/bin/pserve ./syncserver.ini
|
2014-02-06 06:29:34 +00:00
|
|
|
|
2014-04-16 18:06:09 +00:00
|
|
|
.PHONY: clean
|
2014-02-06 06:29:34 +00:00
|
|
|
clean:
|
2014-04-16 18:06:09 +00:00
|
|
|
rm -rf $(ENV)
|