From 3cd9b54497463bb545e4f32710fdbd092e468dc6 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Wed, 12 Apr 2017 13:05:00 +0200 Subject: [PATCH 1/6] use tox --- .gitignore | 1 + MANIFEST.in | 1 + requirements-ci.txt | 1 + tox.ini | 10 ++++++++++ 4 files changed, 13 insertions(+) create mode 100644 requirements-ci.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index d6cdf627..f8165eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ cram.egg-info tags cscope.* .idea +.tox diff --git a/MANIFEST.in b/MANIFEST.in index f4751b6e..f247062b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include .coveragerc .pylintrc .travis.yml Makefile MANIFEST.in include *.md *.rst *.txt contrib/* scripts/* exclude contrib/PKGBUILD +include tox.ini recursive-include examples *.t recursive-include tests *.py *.sh *.t diff --git a/requirements-ci.txt b/requirements-ci.txt new file mode 100644 index 00000000..053148f8 --- /dev/null +++ b/requirements-ci.txt @@ -0,0 +1 @@ +tox diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..3d9ed462 --- /dev/null +++ b/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py27,py34,py35,py36,pypy,pypy3 +minversion = 1.9.0 +skip-missing-interpreters = True + +[testenv] +deps = -rrequirements.txt +commands = + make test +whitelist_externals = make From 12d9c44c7bb0744150ad9b563516f0d0cb92ae06 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Wed, 12 Apr 2017 13:06:03 +0200 Subject: [PATCH 2/6] tox: add flake8 env --- requirements.txt | 1 - setup.cfg | 3 +++ tests/pyflakes.t | 7 ------- tox.ini | 10 +++++++++- 4 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 tests/pyflakes.t diff --git a/requirements.txt b/requirements.txt index e646848f..87fa2fe7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ check-manifest coverage pep8 -pyflakes diff --git a/setup.cfg b/setup.cfg index 3abed0b8..23a979a6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,3 +7,6 @@ universal = true # E301: expected blank line # E302: two new lines between functions/etc. ignore = E129,E261,E301,E302 + +[flake8] +ignore = E129,E261,E301,E302 diff --git a/tests/pyflakes.t b/tests/pyflakes.t deleted file mode 100644 index 1a2a806b..00000000 --- a/tests/pyflakes.t +++ /dev/null @@ -1,7 +0,0 @@ -Skip this test if pyflakes isn't available: - - $ command -v pyflakes > /dev/null || exit 80 - -Check that there are no obvious Python source code errors: - - $ pyflakes "$TESTDIR/.." diff --git a/tox.ini b/tox.ini index 3d9ed462..3ec844bc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,pypy,pypy3 +envlist = py27,py34,py35,py36,pypy,pypy3,flake8 minversion = 1.9.0 skip-missing-interpreters = True @@ -8,3 +8,11 @@ deps = -rrequirements.txt commands = make test whitelist_externals = make + +[testenv:flake8] +basepython = python3.4 +commands = + flake8 setup.py cram +deps = + flake8==3.3.0 +skip_install = True From 84e27c1267e04114d87a9a4634261ba2841a2c90 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Wed, 12 Apr 2017 14:51:54 +0200 Subject: [PATCH 3/6] tox: add manifest env --- requirements.txt | 1 - tests/dist.t | 8 -------- tox.ini | 10 +++++++++- 3 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 tests/dist.t diff --git a/requirements.txt b/requirements.txt index 87fa2fe7..015bc585 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ -check-manifest coverage pep8 diff --git a/tests/dist.t b/tests/dist.t deleted file mode 100644 index 2de920aa..00000000 --- a/tests/dist.t +++ /dev/null @@ -1,8 +0,0 @@ -Skip this test if check-manifest isn't available: - - $ command -v check-manifest > /dev/null || exit 80 - -Confirm that "make dist" isn't going to miss any files: - - $ check-manifest "$TESTDIR/.." - lists of files in version control and sdist match diff --git a/tox.ini b/tox.ini index 3ec844bc..ec6672f7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,pypy,pypy3,flake8 +envlist = py27,py34,py35,py36,pypy,pypy3,flake8,manifest minversion = 1.9.0 skip-missing-interpreters = True @@ -16,3 +16,11 @@ commands = deps = flake8==3.3.0 skip_install = True + +[testenv:manifest] +basepython = python3.4 +commands = + check-manifest +deps = + check-manifest==0.35 +skip_install = True From e1e27d9692eba5e0faf425c962a4d25a54fd7429 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Wed, 12 Apr 2017 14:58:12 +0200 Subject: [PATCH 4/6] tox: add pep8 env --- requirements.txt | 1 - tests/pep8.t | 7 ------- tox.ini | 8 ++++++++ 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 tests/pep8.t diff --git a/requirements.txt b/requirements.txt index 015bc585..4ebc8aea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ coverage -pep8 diff --git a/tests/pep8.t b/tests/pep8.t deleted file mode 100644 index e1c181cb..00000000 --- a/tests/pep8.t +++ /dev/null @@ -1,7 +0,0 @@ -Skip this test if pep8 isn't available: - - $ command -v pep8 > /dev/null || exit 80 - -Check that the Python source code style is PEP 8 compliant: - - $ pep8 --config="$TESTDIR/.."/setup.cfg --repeat "$TESTDIR/.." diff --git a/tox.ini b/tox.ini index ec6672f7..6610b749 100644 --- a/tox.ini +++ b/tox.ini @@ -24,3 +24,11 @@ commands = deps = check-manifest==0.35 skip_install = True + +[testenv:pep8] +basepython = python3.4 +commands = + pep8 --config=setup.cfg --repeat . +deps = + pep8==1.7.0 +skip_install = True From 45f9448f9e297af7359394010d92db650a828b57 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Wed, 12 Apr 2017 15:14:37 +0200 Subject: [PATCH 5/6] fix E305 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index e02112a9..f65d60a4 100755 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ def long_description(): """Get the long description from the README""" return open(os.path.join(sys.path[0], 'README.rst')).read() + setup( author='Brodie Rao', author_email='brodie@bitheap.org', From c7d293bbedf0cc0ba653f7ee08325b9284f19654 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Wed, 12 Apr 2017 15:44:45 +0200 Subject: [PATCH 6/6] make travis work --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 4ebc8aea..e646848f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,4 @@ +check-manifest coverage +pep8 +pyflakes