-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
91 lines (77 loc) · 2.5 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
#****************************************************************************
#* setup.py for pyapi-compat-if
#****************************************************************************
import os
import sys
from setuptools import Extension, find_namespace_packages
version="0.0.1"
proj_dir = os.path.dirname(os.path.abspath(__file__))
try:
import sys
sys.path.insert(0, os.path.join(proj_dir, "python"))
from pyapi_compat_if.__build_num__ import BUILD_NUM
version += ".%s" % str(BUILD_NUM)
except ImportError:
pass
isSrcBuild = False
try:
from ivpm.setup import setup
isSrcBuild = os.path.isdir(os.path.join(proj_dir, "src"))
print("pyapi-compat-if: running IVPM")
except ImportError as e:
from setuptools import setup
print("pyapi-compat-if: running setuptools: %s" % str(e))
if isSrcBuild:
incdir = os.path.join(proj_dir, "src", "include")
else:
incdir = os.path.join(proj_dir, "python/pyapi_compat_if/share/include")
pyapi_compat_if_dir = proj_dir
ext = Extension("pyapi_compat_if.core",
sources=[
os.path.join(pyapi_compat_if_dir, 'python', "core.pyx"),
os.path.join(pyapi_compat_if_dir, 'python', 'PyEvalExt.cpp'),
],
language="c++",
include_dirs=[
os.path.join(pyapi_compat_if_dir, 'src', 'include'),
os.path.join(pyapi_compat_if_dir, 'build/src/pyeval_base/include')
]
)
ext.cython_directives={'language_level' : '3'}
setup_args = dict(
name = "pyapi-compat-if",
version=version,
packages=['pyapi_compat_if'],
package_dir = {'' : 'python'},
author = "Matthew Ballance",
author_email = "matt.ballance@gmail.com",
description = ("Core Verification Stimulus and Coverage library"),
long_description="""
Provides a library for constrained randomization and coverage collection
""",
license = "Apache 2.0",
keywords = ["SystemVerilog", "Verilog", "RTL", "Python"],
url = "https://github.com/mballance-utils/pyapi-compat-if",
install_requires=[
'debug-mgr'
],
setup_requires=[
'setuptools_scm',
'cython'
],
entry_points={
"ivpm.pkginfo": [
"pyapi-compat-if = pyapi_compat_if.pkginfo:PkgInfo"
]
},
ext_modules=[ ext ]
)
if isSrcBuild:
setup_args["ivpm_extdep_pkgs"] = ["debug-mgr"]
setup_args["ivpm_extra_data"] = {
"debug_mgr": {
("src/include", "share"),
("build/{libdir}/{libpref}pyapi-compat-if{dllext}", "")
}
}
setup(**setup_args)