Skip to content

Commit eed8765

Browse files
committed
Skip E402 on Cython Files, Fix E402 Errors
pep8 1.6.0 introduced E402, which warns about module-level imports not being at the top of the file. However, due to a quirk in Cython, we need to set a constant at the top of the files, so disable this check for now. This also fixes an E402 error in `creds.py`.
1 parent 08705fa commit eed8765

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.travis.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ F8_SETUP=$?
66
flake8 gssapi
77
F8_PY=$?
88

9-
flake8 gssapi --filename='*.pyx,*.pxd' --ignore=E225,E226,E227,E901
9+
flake8 gssapi --filename='*.pyx,*.pxd' --ignore=E225,E226,E227,E901,E402
1010
F8_MAIN_CYTHON=$?
1111

1212
python setup.py nosetests

gssapi/creds.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
from gssapi.raw import named_tuples as tuples
33
from gssapi._utils import import_gssapi_extension, _encode_dict
44

5+
from gssapi import names
6+
57
rcred_imp_exp = import_gssapi_extension('cred_imp_exp')
68
rcred_s4u = import_gssapi_extension('s4u')
79
rcred_cred_store = import_gssapi_extension('cred_store')
810
rcred_rfc5588 = import_gssapi_extension('rfc5588')
911

10-
from gssapi import names
11-
1212

1313
class Credentials(rcreds.Creds):
1414
"""GSSAPI Credentials

tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ envlist = py27,py33,py34
88

99
[testenv]
1010
# NB(sross): disabling E225,E226,E227,E901 make pep8 think Cython is ok
11+
# NB(sross): disable E402 because of the GSSAPI="blah" lines needed by Cython
1112
commands =
1213
flake8 setup.py
1314
flake8 gssapi
14-
flake8 gssapi --filename='*.pyx,*.pxd' --ignore=E225,E226,E227,E901
15+
flake8 gssapi --filename='*.pyx,*.pxd' --ignore=E225,E226,E227,E901,E402
1516
python setup.py nosetests []
1617

1718
deps = -r{toxinidir}/test-requirements.txt

0 commit comments

Comments
 (0)