Repository navigation
Expand file tree
/
Copy pathsetup.py.in
More file actions
133 lines (122 loc) · 5.15 KB
/
Copy pathsetup.py.in
File metadata and controls
133 lines (122 loc) · 5.15 KB
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
# This setup.py uses cmake to pass some variables like version
# to the python setup script. Before use, cmake must configure this
# file.
# you may run python setup.py from the binary tree after you have ran cmake
from setuptools import setup
import os
# get source directory
PYOMEXMETA_DIR = "@PYOMEXMETA_DIR@"
"""
Install with
pip install --index-url https://test.pypi.org/simple pyomexmeta
for now.
"""
CLASSIFIERS = """\
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Programming Language :: C
Programming Language :: C++
Programming Language :: Python
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Operating System :: MacOS
Operating System :: POSIX
Operating System :: Unix
"""
binaries = [
os.path.join(PYOMEXMETA_DIR, "concrt140.dll"),
os.path.join(PYOMEXMETA_DIR, "api-ms-win-core-wow64-l1-1-0.dll"),
os.path.join(PYOMEXMETA_DIR, "libcrypto-1_1-x64.dll"),
os.path.join(PYOMEXMETA_DIR, "libcurl.dll"),
# os.path.join(PYOMEXMETA_DIR, "libdb48.dll"),
# os.path.join(PYOMEXMETA_DIR, "libdb-5.3.so"),
os.path.join(PYOMEXMETA_DIR, "libiconv.dll"),
os.path.join(PYOMEXMETA_DIR, "libcharset.dll"),
# os.path.join(PYOMEXMETA_DIR, "libpq.dll"),
os.path.join(PYOMEXMETA_DIR, "libssl-1_1-x64.dll"),
os.path.join(PYOMEXMETA_DIR, "libxml2.dll"),
os.path.join(PYOMEXMETA_DIR, "libxslt.dll"),
os.path.join(PYOMEXMETA_DIR, "lzma.dll"),
os.path.join(PYOMEXMETA_DIR, "msvcp140.dll"),
os.path.join(PYOMEXMETA_DIR, "msvcp140_1.dll"),
os.path.join(PYOMEXMETA_DIR, "msvcp140_2.dll"),
os.path.join(PYOMEXMETA_DIR, "msvcp140_codecvt_ids.dll"),
os.path.join(PYOMEXMETA_DIR, "OmexMeta.dll"),
os.path.join(PYOMEXMETA_DIR, "OmexMetaCAPI.dll"),
os.path.join(PYOMEXMETA_DIR, "pcre.dll"),
os.path.join(PYOMEXMETA_DIR, "redland-combined.dll"),
os.path.join(PYOMEXMETA_DIR, "sqlite3.dll"),
os.path.join(PYOMEXMETA_DIR, "vcruntime140.dll"),
os.path.join(PYOMEXMETA_DIR, "yajl.dll"),
os.path.join(PYOMEXMETA_DIR, "zlib1.dll"),
os.path.join(PYOMEXMETA_DIR, "vcruntime140.dll"),
os.path.join(PYOMEXMETA_DIR, "vcruntime140_1.dll"),
# linux dependencies
os.path.join(PYOMEXMETA_DIR, "libOmexMeta.so.@LIBOMEXMETA_VERSION@"),
os.path.join(PYOMEXMETA_DIR, "libOmexMetaCAPI.so.@LIBOMEXMETA_VERSION@"),
# os.path.join(PYOMEXMETA_DIR, "libsqlite3.so"),
# os.path.join(PYOMEXMETA_DIR, "libxml2.so"),
# Problem with distributing linux dependencies:
# The .so files are actually symlinks. They have a size of 0 and do not
# get packaged into a pip wheel. On linux, its therefore easier to
# get users to install dependencies manually. One solution is
# to copy over the actual so files (i.e. with version number) in cmake
# instead of the symlink.
]
#for i in binaries:
# print(f"Looking for binary \"{i}\"")
# if not os.path.isfile(i):
# raise FileNotFoundError(f"Dependency \"{i}\" not found.")
def find_libomexmeta():
paths = []
libomexmeta = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'site-packages/pyomexmeta/@CMAKE_SHARED_LIBRARY_PREFIX@OmexMetaCAPI-@LIBOMEXMETA_VERSION@@CMAKE_SHARED_LIBRARY_SUFFIX@'
)
if os.path.isfile(libomexmeta):
return libomexmeta
paths.append(libomexmeta)
print("Searched", libomexmeta, "for libomexmeta: exists = ", os.path.isfile(libomexmeta))
libomexmeta = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'site-packages/pyomexmeta/@CMAKE_SHARED_LIBRARY_PREFIX@OmexMetaCAPI.@LIBOMEXMETA_VERSION@@CMAKE_SHARED_LIBRARY_SUFFIX@'
)
if os.path.isfile(libomexmeta):
return libomexmeta
paths.append(libomexmeta)
print("Searched", libomexmeta, "for libomexmeta: exists = ", os.path.isfile(libomexmeta))
libomexmeta = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'site-packages/pyomexmeta/@CMAKE_SHARED_LIBRARY_PREFIX@OmexMetaCAPI@CMAKE_SHARED_LIBRARY_SUFFIX@.@LIBOMEXMETA_VERSION@'
)
if not(os.path.isfile(libomexmeta)):
raise FileNotFoundError(libomexmeta)
return libomexmeta
setup(
name='pyomexmeta',
version='@LIBOMEXMETA_VERSION@',
license='MIT',
long_description=open('@README_FILE@').read(),
long_description_content_type="text/markdown",
author='Ciaran Welsh',
author_email='cwelsh2@uw.edu',
url='https://github.com/sys-bio/libomexmeta',
keywords=['annotation', 'rdf'],
install_requires=open("requirements.txt").read().split("\n"),
packages=['pyomexmeta'],
package_dir={'pyomexmeta': 'site-packages/pyomexmeta'},
package_data={'pyomexmeta': [
'LICENCE.txt', find_libomexmeta(),
]}, # + binaries},
include_package_data=True,
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
platforms=["Windows", "Linux", "Unix", "Mac OS-X"],
has_ext_modules=lambda: True,
)