Skip to content

Commit b8e4c41

Browse files
Merge branch 'imports'
Changes for importing and flake8.
2 parents d13b2dc + 53d7055 commit b8e4c41

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

gssapi/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from gssapi.raw.types import NameType, RequirementFlag, AddressType # noqa
2+
from gssapi.raw.types import MechType, IntEnumFlagSet # noqa
3+
from gssapi.raw.oids import OID # noqa
4+
5+
from gssapi.creds import Credentials # noqa
6+
from gssapi.names import Name # noqa
7+
from gssapi.sec_contexts import SecurityContext # noqa

gssapi/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
from gssapi.raw.exceptions import * # noqa
2+
from gssapi.raw.misc import GSSError # noqa
3+
4+
15
# non-GSS exceptions
26
class GeneralError(Exception):
37
MAJOR_MESSAGE = "General error"

setup.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
2-
from setuptools import setup, Feature
2+
from setuptools import setup, Feature # noqa
33
from setuptools.extension import Extension
44
from Cython.Distutils import build_ext
5-
import sys
5+
import sys # noqa
66
import re
77
import os
88

@@ -13,6 +13,7 @@
1313
get_output = commands.getoutput
1414
except ImportError:
1515
import subprocess
16+
1617
def _get_output(*args, **kwargs):
1718
res = subprocess.check_output(*args, shell=True, **kwargs)
1819
decoded = res.decode('utf-8')
@@ -33,7 +34,8 @@ def _get_output(*args, **kwargs):
3334
link_args = link_args.split()
3435
compile_args = compile_args.split()
3536

36-
ENABLE_SUPPORT_DETECTION = (os.environ.get('GSSAPI_SUPPORT_DETECT', 'true').lower() == 'true')
37+
ENABLE_SUPPORT_DETECTION = \
38+
(os.environ.get('GSSAPI_SUPPORT_DETECT', 'true').lower() == 'true')
3739

3840
if ENABLE_SUPPORT_DETECTION:
3941
main_lib = os.environ.get('GSSAPI_MAIN_LIB', None)
@@ -70,26 +72,29 @@ def run(self):
7072
header.write('#include "gssapi.h"')
7173

7274
for ext in self.extensions:
73-
ext.extra_compile_args.append("-I%s" % os.path.abspath(target_dir))
75+
ext.extra_compile_args.append("-I%s" %
76+
os.path.abspath(target_dir))
7477

7578
build_ext.run(self)
7679

77-
# detect support
7880

81+
# detect support
7982
def main_file(module):
8083
return Extension('gssapi.raw.%s' % module,
81-
extra_link_args = link_args,
82-
extra_compile_args = compile_args,
83-
sources = ['gssapi/raw/%s.pyx' % module])
84+
extra_link_args=link_args,
85+
extra_compile_args=compile_args,
86+
sources=['gssapi/raw/%s.pyx' % module])
87+
8488

8589
def extension_file(module, canary):
8690
if ENABLE_SUPPORT_DETECTION and not hasattr(GSSAPI_LIB, canary):
8791
return None
8892
else:
8993
return Extension('gssapi.raw.ext_%s' % module,
90-
extra_link_args = link_args,
91-
extra_compile_args = compile_args,
92-
sources = ['gssapi/raw/ext_%s.pyx' % module])
94+
extra_link_args=link_args,
95+
extra_compile_args=compile_args,
96+
sources=['gssapi/raw/ext_%s.pyx' % module])
97+
9398

9499
def gssapi_modules(lst):
95100
# filter out missing files
@@ -99,9 +104,9 @@ def gssapi_modules(lst):
99104
MECHS_SUPPORTED = os.environ.get('GSSAPI_MECHS', 'krb5').split(',')
100105
for mech in MECHS_SUPPORTED:
101106
res.append(Extension('gssapi.raw.mech_%s' % mech,
102-
extra_link_args = link_args,
103-
extra_compile_args = compile_args,
104-
sources = ['gssapi/raw/mech_%s.pyx' % mech]))
107+
extra_link_args=link_args,
108+
extra_compile_args=compile_args,
109+
sources=['gssapi/raw/mech_%s.pyx' % mech]))
105110

106111
return res
107112

@@ -132,8 +137,8 @@ def gssapi_modules(lst):
132137
'Topic :: Security',
133138
'Topic :: Software Development :: Libraries :: Python Modules'
134139
],
135-
cmdclass = {'build_ext': build_gssapi_ext},
136-
ext_modules = gssapi_modules([
140+
cmdclass={'build_ext': build_gssapi_ext},
141+
ext_modules=gssapi_modules([
137142
main_file('misc'),
138143
main_file('exceptions'),
139144
main_file('creds'),

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ envlist = py27,py33
99
[testenv]
1010
# NB(sross): disabling E225,E226,E227,E901 make pep8 think Cython is ok
1111
commands =
12+
flake8 setup.py
1213
flake8 gssapi
1314
flake8 gssapi --filename='*.pyx,*.pxd' --ignore=E225,E226,E227,E901
1415
python setup.py nosetests []

0 commit comments

Comments
 (0)