2 from setuptools import setup, Extension
3 # setuptools doesn't support template param for MANIFEST.in
4 from setuptools.command.egg_info import manifest_maker
5 manifest_maker.template = 'python/MANIFEST.in'
7 from distutils.core import setup, Extension
12 LIB_ROOT = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir))
13 if os.getcwd() != LIB_ROOT:
15 if LIB_ROOT not in sys.path:
16 sys.path.append(LIB_ROOT)
20 if sys.version < '2.7':
21 tests_require.append('unittest2')
23 uclmodule = Extension(
25 libraries=['ucl', 'curl'],
26 sources=['python/src/uclmodule.c'],
27 include_dirs=['include'],
32 'sources': ['src/' + fn for fn in os.listdir('src') if fn.endswith('.c')],
33 'include_dirs': ['include', 'src', 'uthash', 'klib'],
34 'macros': [('CURL_FOUND', '1')],
37 # sdist setup() will pull in the *.c files automatically, but not headers
38 # MANIFEST.in will include the headers for sdist only
39 template = 'python/MANIFEST.in'
41 # distutils assume setup.py is in the root of the project
42 # we need to include C source from the parent so trick it
43 in_ucl_root = 'setup.py' in os.listdir('python')
45 os.link('python/setup.py', 'setup.py')
50 description = 'ucl parser and emitter',
51 ext_modules = [uclmodule],
52 template=template, # no longer supported with setuptools but doesn't hurt
53 libraries = [('ucl', ucl_lib)],
55 tests_require = tests_require,
56 author = "Eitan Adler, Denis Volpato Martins",
57 author_email = "lists@eitanadler.com",
58 url = "https://github.com/vstakhov/libucl/",
61 "Development Status :: 3 - Alpha",
62 "Intended Audience :: Developers",
63 "License :: DFSG approved",
64 "License :: OSI Approved :: MIT License",
65 "Programming Language :: C",
66 "Programming Language :: Python :: 2",
67 "Programming Language :: Python :: 3",
68 "Programming Language :: Python :: Implementation :: CPython",
69 "Topic :: Software Development :: Libraries",
73 # clean up the trick after the build