_fill -> canvas._fill
[PyX/mjg.git] / setup.py
blobc3850c66eb9be0106f503519a866d34bb74cbf94
1 #!/usr/bin/env python
2 # -*- coding: ISO-8859-1 -*-
4 """Python package for the generation of encapsulated PostScript figures
6 PyX is a Python package for the creation of encapsulated PostScript figures.
7 It provides both an abstraction of PostScript and a TeX/LaTeX interface.
8 Complex tasks like 2d and 3d plots in publication-ready quality are built out
9 of these primitives.
10 """
12 from distutils.core import setup, Extension
13 import ConfigParser
14 import sys
15 import pyx
18 # build list of extension modules
21 ext_modules = []
22 pykpathsea_ext_module = Extension("pyx.pykpathsea._pykpathsea",
23 sources=["pyx/pykpathsea/pykpathsea.c"],
24 libraries=["kpathsea"])
25 t1strip_ext_module = Extension("pyx.t1strip._t1strip",
26 sources=["pyx/t1strip/t1strip.c", "pyx/t1strip/writet1.c"])
28 # obtain information on which modules have to be built from setup.cfg file
29 cfg = ConfigParser.ConfigParser()
30 cfg.read("setup.cfg")
31 if cfg.has_section("PyX"):
32 if cfg.has_option("PyX", "build_pykpathsea") and cfg.getboolean("PyX", "build_pykpathsea"):
33 ext_modules.append(pykpathsea_ext_module)
34 if cfg.has_option("PyX", "build_t1strip") and cfg.getboolean("PyX", "build_t1strip"):
35 ext_modules.append(t1strip_ext_module)
38 # data files
41 data_files = [('share/pyx', ['pyx/lfs/10pt.lfs',
42 'pyx/lfs/11pt.lfs',
43 'pyx/lfs/12pt.lfs',
44 'pyx/lfs/10ptex.lfs',
45 'pyx/lfs/11ptex.lfs',
46 'pyx/lfs/12ptex.lfs',
47 'pyx/lfs/foils17pt.lfs',
48 'pyx/lfs/foils20pt.lfs',
49 'pyx/lfs/foils25pt.lfs',
50 'pyx/lfs/foils30pt.lfs',
51 'contrib/pyx.def'])]
54 # additional package metadata (only available in Python 2.3 and above)
57 if sys.version_info >= (2, 3):
58 addargs = { "classifiers":
59 [ "Development Status :: 3 - Alpha",
60 "Intended Audience :: Developers",
61 "Intended Audience :: End Users/Desktop",
62 "License :: OSI Approved :: GNU General Public License (GPL)",
63 "Operating System :: OS Independent",
64 "Programming Language :: Python",
65 "Topic :: Multimedia :: Graphics",
66 "Topic :: Scientific/Engineering :: Visualization",
67 "Topic :: Software Development :: Libraries :: Python Modules" ],
68 "download_url":
69 "http://sourceforge.net/project/showfiles.php?group_id=45430",
70 "platforms":
71 "OS independent",
73 else:
74 addargs = {}
76 # We're using the module docstring as the distutils descriptions. (seen in Zope3 setup.py)
77 doclines = __doc__.split("\n")
79 setup(name="PyX",
80 version=pyx.__version__,
81 author="Jörg Lehmann, André Wobst",
82 author_email="pyx-devel@lists.sourceforge.net",
83 url="http://pyx.sourceforge.net/",
84 description=doclines[0],
85 long_description="\n".join(doclines[2:]),
86 license="GPL",
87 packages=['pyx', 'pyx/t1strip', 'pyx/pykpathsea'],
88 ext_modules=ext_modules,
89 data_files=data_files,
90 **addargs)