-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
146 lines (129 loc) · 4.19 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Copyright (c) 2023 NetInCSH. All rights reserved.
# This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
# License. (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
import os
import sys
from glob import glob
from setuptools import setup
with open("netin/__init__.py") as fid:
for line in fid:
if line.startswith("__version__"):
version = line.strip().split()[-1][1:-1]
break
if sys.version_info[:2] < (3, 8):
error = (f"NetIn {version} requires Python 3.9 or later ({sys.version_info[:2]} detected). \n")
sys.stderr.write(error + "\n")
sys.exit(1)
name = "netin"
description = "Python package to study inequalities in social networks"
authors = {
"Karimi": ("Fariba Karimi", "karimi@csh.ac.at"),
"Espín-Noboa": ("Lisette Espín-Noboa", "espin@csh.ac.at"),
"Bachmann": ("Jan Bachmann", "bachmann@csh.ac.at"),
}
maintainer = "NetIn Developers"
maintainer_email = "netin-dev@googlegroups.com"
url = "https://github.com/CSHVienna/NetworkInequalities"
platforms = ["Linux", "Mac OSX", "Windows", "Unix"]
keywords = [
"Networks",
"Inequalities",
"Social Networks",
"Ranking",
"Inference"
"Graph Theory",
"Mathematics",
"network",
"undirected",
"discrete mathematics",
"math",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
]
packages = [
"netin",
"netin.generators",
"netin.utils",
"netin.stats",
"netin.viz",
"netin.algorithms.sampling",
"netin.generators.tests",
]
docdirbase = "share/doc/netin-%s" % version
# add basic documentation
data = [(docdirbase, glob("*.txt"))]
# add examples
for d in [
".",
"directed",
"undirected",
"notebooks",
"advanced",
"algorithms",
"basic",
"drawing",
"subclass",
]:
dd = os.path.join(docdirbase, "examples", d)
pp = os.path.join("examples", d)
data.append((dd, glob(os.path.join(pp, "*.txt"))))
data.append((dd, glob(os.path.join(pp, "*.py"))))
data.append((dd, glob(os.path.join(pp, "*.bz2"))))
data.append((dd, glob(os.path.join(pp, "*.gz"))))
data.append((dd, glob(os.path.join(pp, "*.mbox"))))
data.append((dd, glob(os.path.join(pp, "*.edgelist"))))
# add js force examples
dd = os.path.join(docdirbase, "examples", "javascript/force")
pp = os.path.join("examples", "javascript/force")
data.append((dd, glob(os.path.join(pp, "*"))))
# add the tests subpackage(s)
package_data = {
"netin": ["tests/*.py"],
"netin.generators": ["tests/*.py"],
}
def parse_requirements_file(filename):
with open(filename) as fid:
requires = [l.strip() for l in fid.readlines() if not l.startswith("#")]
return requires
install_requires = parse_requirements_file("requirements/default.txt")
extras_require = {
dep: parse_requirements_file("requirements/" + dep + ".txt")
for dep in ["default", "test"] # , "developer", "doc", "extra"]
}
with open("README.rst") as fh:
long_description = fh.read()
if __name__ == "__main__":
setup(
name=name,
version=version,
maintainer=maintainer,
maintainer_email=maintainer_email,
author=authors["Espín-Noboa"][0],
author_email=authors["Espín-Noboa"][1],
description=description,
keywords=keywords,
long_description=long_description,
long_description_content_type="text/x-rst",
platforms=platforms,
url=url,
classifiers=classifiers,
packages=packages,
data_files=data,
package_data=package_data,
install_requires=install_requires,
extras_require=extras_require,
python_requires=">=3.9",
zip_safe=False,
)