diff --git a/.gitignore b/.gitignore index fd412777..fcefbc50 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ target/ # subiquity installer images installer/*.img logs/* +venv diff --git a/Makefile b/Makefile index 42ad483b..8a90b46a 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,10 @@ # Makefile for subiquity # PYTHONSRC=subiquity +PYTHONPATH=$(shell pwd):$(shell pwd)/probert:$PYTHONPATH +VENVPATH=$(shell pwd)/venv +VENVACTIVATE=$(VENVPATH)/bin/activate +TOPDIR=$(shell pwd) STREAM=daily RELEASE=wily ARCH=amd64 @@ -10,8 +14,18 @@ INSTALLER_RESOURCES += $(shell find installer/resources -type f) .PHONY: run clean -ui-view: - (PYTHONPATH=$(shell pwd):$(shell pwd)/probert bin/$(PYTHONSRC)) +setup-virtualenv: + @if [ ! -d $(VENVPATH) ]; then virtualenv venv; fi + (/bin/bash -c "source $(VENVACTIVATE)") + +install-requirements: setup-virtualenv + @pip install -rrequirements.txt -q + +upgrade-pip: setup-virtualenv + @pip install --upgrade pip + +ui-view: install-requirements + (PYTHONPATH=$(PYTHONPATH) bin/$(PYTHONSRC)) lint: echo "Running flake8 lint tests..." diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..50334a99 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +urwid==1.3.0 +pyudev==0.16.1 +netifaces==0.10.4 +nose-cov +nose +flake8 diff --git a/test/.gitkeep b/tests/.gitkeep similarity index 100% rename from test/.gitkeep rename to tests/.gitkeep