2018-10-02 13:31:02 +00:00
|
|
|
# Once there is Python 3 support in this package and it's dependencies
|
|
|
|
# the detection of the used Python version should be changed.
|
|
|
|
# The following line prefers `python` as this will allow this to work
|
|
|
|
# in CI (e.g. Travis CI) and put up the configured Python version:
|
|
|
|
# SYSTEMPYTHON = `which python python3 python2 | head -n 1`
|
2020-09-08 06:21:18 +00:00
|
|
|
SYSTEMPYTHON = `which python2 python2.7 python | head -n 1`
|
2018-10-19 20:04:02 +00:00
|
|
|
VIRTUALENV = $(SYSTEMPYTHON) -m 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
|
2014-10-22 04:03:19 +00:00
|
|
|
|
|
|
|
# Hackety-hack around errors duing compile of ultramemcached.
|
2014-12-15 00:45:18 +00:00
|
|
|
CFLAGS = "-Wno-error -Wno-error=format-security"
|
2014-10-22 04:03:19 +00:00
|
|
|
|
|
|
|
INSTALL = CFLAGS=$(CFLAGS) ARCHFLAGS=$(ARCHFLAGS) $(ENV)/bin/pip install
|
|
|
|
|
2014-05-15 07:51:32 +00:00
|
|
|
|
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
|
2014-07-16 10:16:25 +00:00
|
|
|
build: | $(ENV)/COMPLETE
|
|
|
|
$(ENV)/COMPLETE: requirements.txt
|
2014-04-16 18:06:09 +00:00
|
|
|
$(VIRTUALENV) --no-site-packages $(ENV)
|
2018-09-17 01:49:07 +00:00
|
|
|
$(INSTALL) -i https://pypi.python.org/simple -U pip
|
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-07-16 10:16:25 +00:00
|
|
|
touch $(ENV)/COMPLETE
|
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
|
|
|
|
|
2017-05-26 01:44:36 +00:00
|
|
|
# Test against a running server.
|
2015-05-12 07:25:13 +00:00
|
|
|
$(ENV)/bin/gunicorn --paste syncserver/tests.ini 2> /dev/null & SERVER_PID=$$!; \
|
2014-04-16 18:06:09 +00:00
|
|
|
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-07-16 10:16:25 +00:00
|
|
|
$(TOOLS): | $(ENV)/COMPLETE
|
2017-05-26 01:44:36 +00:00
|
|
|
$(INSTALL) -r dev-requirements.txt
|
2014-02-06 06:29:34 +00:00
|
|
|
|
2014-04-16 18:06:09 +00:00
|
|
|
.PHONY: serve
|
2014-07-16 10:16:25 +00:00
|
|
|
serve: | $(ENV)/COMPLETE
|
2015-05-12 07:25:13 +00:00
|
|
|
$(ENV)/bin/gunicorn --paste ./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)
|