- Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
76 lines (66 loc) · 2.37 KB
/
Copy pathsetup.py
File metadata and controls
76 lines (66 loc) · 2.37 KB
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
76
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""C Extension for faster UUID generation using libuuid."""
__version_info__= (0, 9, 0)
__version__=".".join(map(str, __version_info__))
__author__="Daniel Lundin"
__contact__="dln@eintr.org"
__homepage__="http://github.com/dln/python-libuuid/"
__docformat__="restructuredtext"
importcodecs
importos
fromglobimportglob
try:
importsetuptools
exceptImportError:
fromez_setupimportuse_setuptools
use_setuptools()
fromsetuptoolsimportsetup, find_packages, Extension
fromdistutils.command.sdistimportsdist
extra_setup_args= {}
try:
fromCython.Distutilsimportbuild_ext
importCython.Compiler.Version
importCython.Compiler.Mainascython_compiler
print("building with Cython "+Cython.Compiler.Version.version)
classSdist(sdist):
def__init__(self, *args, **kwargs):
forsrcinglob('libuuid/*.pyx'):
cython_compiler.compile(glob('libuuid/*.pyx'),
cython_compiler.default_options)
sdist.__init__(self, *args, **kwargs)
extra_setup_args['cmdclass'] = {'build_ext': build_ext, 'sdist': Sdist}
source_extension=".pyx"
exceptImportError:
print("building without Cython")
source_extension=".c"
ext_modules= [
Extension('libuuid._uuid',
sources=['libuuid/_uuid'+source_extension],
libraries=['uuid'])
]
long_description='\n'+codecs.open('README.rst', "r", "utf-8").read()
setup(name='python-libuuid',
version=__version__,
description=__doc__,
author=__author__,
author_email=__contact__,
license='BSD',
url=__homepage__,
packages= ['libuuid'],
ext_modules=ext_modules,
zip_safe=False,
test_suite="nose.collector",
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Cython",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Topic :: Communications",
"Topic :: System :: Distributed Computing",
"Topic :: Software Development :: Libraries :: Python Modules",
],
long_description=long_description,
**extra_setup_args
)