1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ffsync_ynh.git synced 2024-09-03 18:26:38 +02:00
ffsync_ynh/sources/Makefile

46 lines
1.2 KiB
Makefile
Raw Normal View History

2014-11-15 17:24:32 +01:00
SYSTEMPYTHON = `which python2 python | head -n 1`
VIRTUALENV = virtualenv --python=$(SYSTEMPYTHON)
ENV = ./local
TOOLS := $(addprefix $(ENV)/bin/,flake8 nosetests)
# 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-12-30 16:13:51 +01:00
INSTALL = ARCHFLAGS=$(ARCHFLAGS) $(ENV)/bin/pip install
2014-11-15 17:24:32 +01:00
.PHONY: all
all: build
.PHONY: build
2014-12-30 16:13:51 +01:00
build: | $(ENV)
$(ENV): requirements.txt
2014-11-15 17:24:32 +01:00
$(VIRTUALENV) --no-site-packages $(ENV)
$(INSTALL) -r requirements.txt
$(ENV)/bin/python ./setup.py develop
2014-12-30 16:13:51 +01:00
touch $(ENV)
2014-11-15 17:24:32 +01: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 2> /dev/null & 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-12-30 16:13:51 +01:00
$(TOOLS): | $(ENV)
2014-11-15 17:24:32 +01:00
$(INSTALL) nose flake8
.PHONY: serve
2014-12-30 16:13:51 +01:00
serve: | $(ENV)
2014-11-15 17:24:32 +01:00
$(ENV)/bin/pserve ./syncserver.ini
.PHONY: clean
clean:
rm -rf $(ENV)