-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
86 lines (76 loc) · 2.38 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
"""Installation script."""
import setuptools
# inline:
# from promela import yacc
DESCRIPTION = (
'Parser and abstract syntax tree for the Promela modeling language.')
README = 'README.md'
PROJECT_URLS = {
'Bug Tracker':
'https://github.com/johnyf/promela/issues',
'Documentation':
'https://github.com/johnyf/promela/blob/main/doc.md',}
VERSION_FILE = 'promela/_version.py'
VERSION = '0.0.5'
VERSION_FILE_TEXT = (
'# This file was generated from setup.py\n'
f"version = '{VERSION}'\n")
PYTHON_REQUIRES = '>=3.9'
INSTALL_REQUIRES = [
'networkx >= 2.0',
'ply >= 3.4, <= 3.10']
CLASSIFIERS = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Scientific/Engineering']
KEYWORDS = [
'promela', 'parser', 'syntax tree', 'ply', 'lex', 'yacc']
def _build_parser_table():
if not _ply_is_installed():
return
from promela import yacc
tabmodule = yacc.TABMODULE.rpartition('.')[-1]
outputdir = 'promela/'
parser = yacc.Parser()
parser.build(
tabmodule,
outputdir=outputdir,
write_tables=True)
def _ply_is_installed():
try:
import ply
except ImportError:
print('WARNING: `promela` could not cache parser tables '
'(ignore this if running only for "egg_info").')
return False
return True
def run_setup():
with open(VERSION_FILE, 'w') as f:
f.write(VERSION_FILE_TEXT)
_build_parser_table()
with open(README) as f:
long_description = f.read()
setuptools.setup(
name='promela',
version=VERSION,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type='text/markdown',
author='Ioannis Filippidis',
author_email='jfilippidis@gmail.com',
url='https://github.com/johnyf/promela',
project_urls=PROJECT_URLS,
license='BSD',
python_requires=PYTHON_REQUIRES,
install_requires=INSTALL_REQUIRES,
# tests_require=['pytest'],
packages=['promela'],
package_dir={'promela': 'promela'},
classifiers=CLASSIFIERS,
keywords=KEYWORDS)
if __name__ == '__main__':
run_setup()