-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
75 lines (55 loc) · 1.68 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import os.path
try:
from setuptools import setup, find_packages
except ImportError:
from gssapi_ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from distutils.command.build import build
from setuptools.command.install import install
def get_ext_modules():
from gssapi.bindings import ffi
return [ffi.verifier.get_extension()]
class CFFIBuild(build):
def finalize_options(self):
self.distribution.ext_modules = get_ext_modules()
build.finalize_options(self)
class CFFIInstall(install):
def finalize_options(self):
self.distribution.ext_modules = get_ext_modules()
install.finalize_options(self)
REQUIRES = [
'cffi>=0.8',
'six>=1.5.0',
'pyasn1>=0.1.2',
]
base_dir = os.path.dirname(__file__)
about = {}
with open(os.path.join(base_dir, "gssapi", "__about__.py")) as f:
exec(f.read(), about)
setup(
name=about["__title__"],
version=about["__version__"],
packages=find_packages(exclude=["tests.*", "tests"]),
py_modules=["gssapi_ez_setup"],
# package_data specifies what is included in a bdist
package_data={
"gssapi.bindings": ["*.cdef"]
},
setup_requires=REQUIRES,
install_requires=REQUIRES,
# for cffi
zip_safe=False,
ext_package="gssapi.bindings",
cmdclass={
"build": CFFIBuild,
"install": CFFIInstall,
},
# metadata for upload to PyPI
author=about["__author__"],
author_email="[email protected]",
description="An object-oriented interface to GSSAPI for Python",
license=about["__license__"],
keywords="gssapi kerberos",
url="https://github.com/sigmaris/python-gssapi",
)