-
Notifications
You must be signed in to change notification settings - Fork 29
/
setup.py
83 lines (78 loc) · 3.3 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
#!/usr/bin/env python
from distutils.core import setup
def doc_files () :
import os, os.path
result = {}
for root, dirs, files in os.walk("doc") :
target_dir = os.path.join("share/doc/python-snakes",
*root.split(os.sep)[1:])
for name in files :
if target_dir not in result :
result[target_dir] = []
result[target_dir].append(os.path.join(root, name))
return list(result.items())
def resources (root) :
collected = ["*.txt", "*.html", "*.css", "*.js", "*.png", "*.jpg",
"*.ttf", "*.eot", "*.woff", "*.svg" ,"*.map"]
import fnmatch, os, os.path
result = []
baselen = len(root.rstrip(os.sep).rsplit(os.sep, 1)[0]) + len(os.sep)
def addfiles (dirname, filenames) :
for name in filenames :
for glob in collected :
if fnmatch.fnmatch(name, glob) :
result.append(os.path.join(dirname[baselen:], name))
break
for dirname, _, files in os.walk(root) :
addfiles(dirname, files)
return result
try :
long_description=open("README").read()
except :
long_description="""SNAKES is a general purpose Petri net Python
library allowing to define and execute most classes of Petri
nets. It features a plugin system to allow its extension. In
particular, plugins are provided to implement the operations
usually found in the PBC and M-nets family."""
if __name__ == "__main__" :
emacs = [("share/emacs/site-lisp", ["utils/abcd-mode.el",
"utils/abcd-mode.elc"])]
setup(name="SNAKES",
version=open("VERSION").read().strip(),
description="SNAKES is the Net Algebra Kit for Editors and Simulators",
long_description=long_description,
author="Franck Pommereau",
author_email="[email protected]",
maintainer="Franck Pommereau",
maintainer_email="[email protected]",
url="http://snakes.ibisc.univ-evry.fr/",
scripts=["bin/abcd",
"bin/snkc",
"bin/snkd",
],
packages=["snakes",
"snakes.lang",
"snakes.lang.abcd",
"snakes.lang.ctlstar",
"snakes.lang.pylib",
"snakes.lang.python",
"snakes.plugins",
"snakes.utils",
"snakes.utils.abcd",
"snakes.utils.ctlstar",
"snakes.utils.simul",
],
package_data={"snakes.utils.abcd": resources("snakes/utils/abcd/resources/"),
"snakes.utils.simul": resources("snakes/utils/simul/resources/"),
},
data_files=doc_files() + emacs,
classifiers=[
"Intended Audience :: Science/Research",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)