Skip to content

Commit

Permalink
Migrated pep8, pyflakes, pychecker, pylint to tox.
Browse files Browse the repository at this point in the history
Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>
  • Loading branch information
mkouhei committed Dec 20, 2014
1 parent ccd69a7 commit 8a4c6ba
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 77 deletions.
41 changes: 0 additions & 41 deletions pydebsign/tests/test_pep8.py

This file was deleted.

2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --pep8 --flakes --cov-report=term --cov-report=html
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from setuptools.command.test import test as TestCommand
import subprocess
import shlex
import multiprocessing


class Tox(TestCommand):
Expand Down Expand Up @@ -48,7 +47,11 @@ def run_tests(self):
requires = ['setuptools',
'python_gnupg',
'python_debian',
'chardet']
'chardet',
'sphinx']

with open('requirements.txt', 'w') as _file:
_file.write('\n'.join(requires))


def check_debian_packages():
Expand Down
29 changes: 24 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[tox]
#envlist = py27,py32,py33,py34,pypy
envlist = py27,py33,py34,pypy
envlist =
py27,
py34,
pypy,
docs,
pychecker,
pylint

[testenv]
commands =
Expand All @@ -11,10 +16,9 @@ deps=
python_gnupg
python_debian
chardet
pep8
coverage
pytest
pytest-cov
pytest-pep8
pytest-flakes


[testenv:py27]
Expand All @@ -41,3 +45,18 @@ basepython = python3.4
deps=
{[py]deps}
basepython = pypy

[testenv:docs]
commands =python setup.py build_sphinx

[testenv:pychecker]
deps=
http://sourceforge.net/projects/pychecker/files/latest/download#egg=PyChecker
basepython = python2.7
commands = pychecker -F pydebsign/*.py

[testenv:pylint]
deps=
pylint
commands =
pylint pydebsign --rcfile={toxinidir}/.pylintrc
36 changes: 9 additions & 27 deletions utils/pre-commit.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#!/bin/sh

cleanup() {
find pydebsign -name '*.pyc' -delete
find pydebsign -name '*~' -delete
}

cd $(git rev-parse --show-toplevel)
cleanup
python setup.py test || exit 1
python setup.py check -r || exit 1

cleanup
pychecker pydebsign/*.py
pychecker pydebsign/tests/*.py

cleanup
pylint pydebsign

cleanup
pyflakes pydebsign

cleanup
pyflakes3 pydebsign

cleanup
flake8 pydebsign/*
#!/bin/sh -e

rootdir=$(git rev-parse --show-toplevel)
(
cd $rootdir
find ./ -name *.pyc -delete
tox
python setup.py check -r
)

0 comments on commit 8a4c6ba

Please sign in to comment.