From e2b4f2d0b3164c66e89ea520aa7bca654106dfd7 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Fri, 25 Sep 2015 14:54:04 -0400 Subject: [PATCH] Add requirements files, tox.ini updates This patch updates the tox.ini file to create virtualenv's using the new requirements files. Also, adds a helper task to run reviewday in a tox virtualenv. Useful on distros that don't have launchpadlib packages handy... Change-Id: I4fd2f70859d02a2402ed3b2387e1a6ffbcf588fd --- README.md | 6 +++++- requirements.txt | 4 ++++ reviewday/mergeprop.py | 2 +- test-requirements.txt | 1 + tox.ini | 15 ++++++++++++--- 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 requirements.txt create mode 100644 test-requirements.txt diff --git a/README.md b/README.md index d62d05e..f366fd8 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,11 @@ HTML report generator which creates a prioritized review list w/ function test r PYTHONPATH=$PWD ./bin/reviewday -An output directory called 'out_report' is generated in the current directory. +An output directory called 'out\_report' is generated in the current directory. + +Alternately you can execute reviewday in a tox environment by using: + + tox -erun ## License diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..68861c4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +launchpadlib +PyYAML +Cheetah +simplejson diff --git a/reviewday/mergeprop.py b/reviewday/mergeprop.py index d2776f7..cc381e6 100644 --- a/reviewday/mergeprop.py +++ b/reviewday/mergeprop.py @@ -22,7 +22,7 @@ class MergeProp(object): try: if self.topic.find('bug/') == 0: bug = lp.bug(self.topic[4:]) - #FIXME: bug.importance doesn't seem to work but it should? + # FIXME: bug.importance doesn't seem to work but it should? cause = '%s bugfix' % bug.bug_tasks[0].importance elif self.topic.find('bp/') == 0: spec = lp.specification(self.project, self.topic[3:]) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..3930480 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +flake8 diff --git a/tox.ini b/tox.ini index fedffa8..8f0243a 100644 --- a/tox.ini +++ b/tox.ini @@ -2,12 +2,21 @@ envlist = pyflakes, pep8, py27 [testenv] -install_command = pip install --allow-external lazr.authentication --allow-insecure lazr.authentication -U {opts} {packages} +usedevelop = True +setenv = VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt + +[testenv:venv] +commands = {posargs} [testenv:pyflakes] deps = pyflakes commands = pyflakes setup.py reviewday bin [testenv:pep8] -deps = pep8==1.3.3 -commands = pep8 --ignore=E125 --repeat --show-source --exclude=.tox . +whitelist_externals = bash +commands = flake8 + +[testenv:run] +commands = reviewday {posargs}