forked from pygraphviz/pygraphviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
115 lines (105 loc) · 3.83 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
from glob import glob
import os
import sys
from setuptools import setup, Extension
if sys.version_info[:2] < (3, 9):
error = (
"PyGraphviz requires Python version 3.9 or later (%d.%d detected)."
% sys.version_info[:2]
)
sys.stderr.write(error + "\n")
sys.exit(-1)
name = "pygraphviz"
description = "Python interface to Graphviz"
with open("README.rst") as fh:
long_description = fh.read()
license = "BSD"
authors = {
"Hagberg": ("Aric Hagberg", "aric.hagberg@gmail.com"),
"Schult": ("Dan Schult", "dschult@colgate.edu"),
"Renieris": ("Manos Renieris", ""),
}
url = "http://pygraphviz.github.io"
project_urls = {
"Documentation": "https://pygraphviz.github.io/documentation/stable/",
"Source": "https://github.com/pygraphviz/pygraphviz",
}
download_url = "https://pypi.python.org/pypi/pygraphviz"
platforms = ["Linux", "Mac OSX", "Microsoft :: Windows"]
keywords = ["Networks", "Graph Visualization", "network", "graph", "graph drawing"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Visualization",
]
with open("pygraphviz/__init__.py") as fid:
for line in fid:
if line.startswith("__version__"):
version = line.strip().split()[-1][1:-1]
break
packages = ["pygraphviz", "pygraphviz.tests"]
docdirbase = f"share/doc/pygraphviz-{version}"
data = [
(docdirbase, glob("*.txt")),
(os.path.join(docdirbase, "examples"), glob("examples/*.py")),
(os.path.join(docdirbase, "examples"), glob("examples/*.dat")),
(os.path.join(docdirbase, "examples"), glob("examples/*.dat.gz")),
]
package_data = {
"": ["*.txt"],
}
if __name__ == "__main__":
define_macros = [("SWIG_PYTHON_STRICT_BYTE_CHAR", None)]
if sys.platform == "win32":
define_macros.append(("GVDLL", None))
extension = [
Extension(
"pygraphviz._graphviz",
["pygraphviz/graphviz_wrap.c"],
include_dirs=[],
library_dirs=[],
# cdt does not link to cgraph, whereas cgraph links to cdt.
# thus, cdt needs to come first in the library list to be sure
# that both libraries are linked in the final built .so (if cgraph
# is first, the implicit inclusion of cdt can lead to an incomplete
# link list, having only cdt and preventing the module from being loaded with
# undefined symbol errors. seen under PyPy on Linux.)
libraries=["cdt", "cgraph", "gvc"],
define_macros=define_macros,
)
]
setup(
name=name,
version=version,
author=authors["Hagberg"][0],
author_email=authors["Hagberg"][1],
description=description,
keywords=keywords,
long_description=long_description,
license=license,
platforms=platforms,
url=url,
project_urls=project_urls,
download_url=download_url,
classifiers=classifiers,
packages=packages,
data_files=data,
ext_modules=extension,
package_data=package_data,
include_package_data=True,
python_requires=">=3.9",
tests_require=["pytest"],
)