-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·78 lines (62 loc) · 2.91 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
76
77
78
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""Python package for the generation of PostScript, PDF, and SVG files
PyX is a Python package for the creation of PostScript, PDF, and SVG files. It
combines an abstraction of the PostScript drawing model with a TeX/LaTeX
interface. Complex tasks like 2d and 3d plots in publication-ready quality are
built out of these primitives."""
import sys
if sys.version_info[0] == 2:
print("""*** Sorry, this version of PyX runs on Python 3 only. ***
If you want to use PyX on Python 2, please use one of our
old releases up to PyX 0.12.x, i.e. execute something like:
pip install pyx==0.12.1
""")
exit()
import configparser
import pyx.version
cfg = configparser.ConfigParser()
cfg.read("setup.cfg")
# obtain information on which modules have to be built and whether to use setuptools
# instead of distutils from setup.cfg file
if cfg.has_section("PyX"):
if cfg.has_option("PyX", "use_setuptools") and cfg.getboolean("PyX", "use_setuptools"):
from setuptools import setup, Extension
setuptools_args={"zip_safe": True}
else:
from distutils.core import setup, Extension
setuptools_args={}
# build list of extension modules
ext_modules = []
pykpathsea_ext_module = Extension("pyx.pykpathsea",
sources=["pyx/pykpathsea.c"],
libraries=["kpathsea"])
t1code_ext_module = Extension("pyx.font._t1code",
sources=["pyx/font/_t1code.c"])
if cfg.has_option("PyX", "build_pykpathsea") and cfg.getboolean("PyX", "build_pykpathsea"):
ext_modules.append(pykpathsea_ext_module)
if cfg.has_option("PyX", "build_t1code") and cfg.getboolean("PyX", "build_t1code"):
ext_modules.append(t1code_ext_module)
description, long_description = __doc__.split("\n\n", 1)
setup(name="PyX",
version=pyx.version.version,
author="Jörg Lehmann, André Wobst",
author_email="pyx-devel@lists.sourceforge.net",
url="http://pyx.sourceforge.net/",
description=description,
long_description=long_description,
license="GPL",
packages=["pyx", "pyx/graph", "pyx/graph/axis", "pyx/font", "pyx/dvi", "pyx/metapost"],
package_data={"pyx": ["data/afm/*", "data/lfs/*", "data/def/*", "data/pyxrc"]},
ext_modules=ext_modules,
classifiers=["Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Multimedia :: Graphics",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: Libraries :: Python Modules"],
platforms="OS independent",
**setuptools_args)