Skip to content

Commit 240bec4

Browse files
committed
Clean Up Setup.py Before Publish
`setup.py` will now automatically detect support for Cython and compile with Cython when available. Otherwise, it will try to compile with the C files. `MANIFEST.in` now keeps the C files along with the Cython files, so that running `setup.py sdist` will keep the C files in the generated source distribution. Finally, the "author" of the project has been changed to "The Python GSSAPI Team". The license has been updated to reflect this. The actual license itself has been changed into a more streamlined ISC license.
1 parent b8e4c41 commit 240bec4

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

LICENSE.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
Copyright (c) 2013, Solly Ross
2-
All rights reserved.
1+
Copyright (c) 2014, The Python GSSAPI Team
32

4-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
3+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
54

6-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8-
9-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

MANIFEST.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
include *.txt
22
recursive-include docs *.txt
3-
4-
recursive-include sys_src *.h
5-
63
recursive-include gssapi *.pxd
4+
recursive-include gssapi *.c

setup.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/usr/bin/env python
2-
from setuptools import setup, Feature # noqa
2+
from setuptools import setup
3+
from setuptools.command.build_ext import build_ext
34
from setuptools.extension import Extension
4-
from Cython.Distutils import build_ext
5-
import sys # noqa
65
import re
76
import os
87

8+
9+
try:
10+
from Cython.Build import cythonize
11+
SOURCE_EXT = 'pyx'
12+
except ImportError:
13+
SOURCE_EXT = 'c'
14+
915
get_output = None
1016

1117
try:
@@ -83,7 +89,7 @@ def main_file(module):
8389
return Extension('gssapi.raw.%s' % module,
8490
extra_link_args=link_args,
8591
extra_compile_args=compile_args,
86-
sources=['gssapi/raw/%s.pyx' % module])
92+
sources=['gssapi/raw/%s.%s' % (module, SOURCE_EXT)])
8793

8894

8995
def extension_file(module, canary):
@@ -93,7 +99,8 @@ def extension_file(module, canary):
9399
return Extension('gssapi.raw.ext_%s' % module,
94100
extra_link_args=link_args,
95101
extra_compile_args=compile_args,
96-
sources=['gssapi/raw/ext_%s.pyx' % module])
102+
sources=['gssapi/raw/ext_%s.%s' % (module,
103+
SOURCE_EXT)])
97104

98105

99106
def gssapi_modules(lst):
@@ -106,7 +113,11 @@ def gssapi_modules(lst):
106113
res.append(Extension('gssapi.raw.mech_%s' % mech,
107114
extra_link_args=link_args,
108115
extra_compile_args=compile_args,
109-
sources=['gssapi/raw/mech_%s.pyx' % mech]))
116+
sources=['gssapi/raw/mech_%s.%s' % (mech,
117+
SOURCE_EXT)]))
118+
119+
if SOURCE_EXT == 'pyx':
120+
res = cythonize(res)
110121

111122
return res
112123

@@ -116,9 +127,9 @@ def gssapi_modules(lst):
116127
open('README.txt').read())))
117128

118129
setup(
119-
name='PyGSSAPI',
130+
name='PythonGSSAPI',
120131
version='1.0.0',
121-
author='Solly Ross',
132+
author='The Python GSSAPI Team',
122133
author_email='sross@redhat.com',
123134
packages=['gssapi', 'gssapi.raw', 'gssapi.tests'],
124135
description='Python GSSAPI Wrapper',
@@ -128,12 +139,13 @@ def gssapi_modules(lst):
128139
classifiers=[
129140
'Development Status :: 4 - Beta',
130141
'Programming Language :: Python',
131-
'Programming Language :: Python :: 2.6',
132142
'Programming Language :: Python :: 2.7',
133143
'Programming Language :: Python :: 3',
144+
'Programming Language :: Python :: 3.3',
134145
'Intended Audience :: Developers',
135-
'License :: OSI Approved :: BSD License',
146+
'License :: OSI Approved :: ISC License (ISCL)',
136147
'Programming Language :: Python :: Implementation :: CPython',
148+
'Programming Language :: Cython',
137149
'Topic :: Security',
138150
'Topic :: Software Development :: Libraries :: Python Modules'
139151
],
@@ -153,6 +165,7 @@ def gssapi_modules(lst):
153165
extension_file('cred_store', 'gss_store_cred_into'),
154166
extension_file('rfc5588', 'gss_store_cred'),
155167
]),
168+
keywords=['gssapi', 'security'],
156169
install_requires=[
157170
'enum34',
158171
'decorator'

0 commit comments

Comments
 (0)