-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
115 lines (96 loc) · 4.32 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
import os
import sys
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext as build_ext_orig
if sys.version_info < (3, 8):
raise RuntimeError('Require Python 3.8 or greater')
PACKAGE_NAME = 'pyreindexer'
def _c2(*names):
return ' :: '.join(names)
class CMakeExtension(Extension):
def __init__(self, name):
super().__init__(name, sources=[])
class BuildExt(build_ext_orig):
def run(self):
for ext in self.extensions:
self.build_cmake(ext)
def build_cmake(self, ext):
cwd = os.path.abspath('')
build_temp = os.path.abspath(self.build_temp)
if not os.path.exists(build_temp):
os.makedirs(build_temp)
extension_dir = os.path.abspath(self.get_ext_fullpath(ext.name))
if not os.path.exists(extension_dir):
os.makedirs(extension_dir)
os.chdir(build_temp)
lib_dir = os.path.join(extension_dir, '..')
source_dir = os.path.join(cwd, PACKAGE_NAME)
self.spawn(['cmake', source_dir,
'-DCMAKE_BUILD_TYPE=RelWithDebInfo',
'-DCMAKE_CXX_STANDARD=20',
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + lib_dir,
'-DCMAKE_OSX_DEPLOYMENT_TARGET=11'])
if not self.dry_run:
self.spawn(['cmake', '--build', '.'])
os.chdir(cwd)
with open('README.md', 'r', encoding='utf-8') as file:
LONG_DESCRIPTION = file.read()
setup(name=PACKAGE_NAME,
version='0.4.5',
description='A connector that allows to interact with Reindexer. Reindexer static library or reindexer-dev package must be installed',
author='Igor Tulmentyev',
author_email='contactus@reindexer.io',
maintainer='Reindexer Team',
maintainer_email='contactus@reindexer.io',
url='https://github.com/Restream/reindexer',
download_url='https://github.com/Restream/reindexer-py',
project_urls={
'Documentation': 'https://reindexer.io/',
#'Releases': 'https://github.com/Restream/reindexer-py/releases',
#'Tracker': 'https://github.com/Restream/reindexer-py/issues',
'Telegram chat': 'https://t.me/reindexer',
},
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
license='Apache License 2.0',
packages=[PACKAGE_NAME],
ext_modules=[CMakeExtension('rawpyreindexer')],
cmdclass={'build_ext': BuildExt},
keywords=['reindexer', 'reindexer-py', 'in-memory-database', 'database', 'python', 'connector'],
package_data={'pyreindexer': [
'CMakeLists.txt',
'lib/**/*.h',
'lib/**/*.cc',
'example/main.py',
'tests/**/*.py'
]},
python_requires='>=3.8',
install_requires=['delegator==0.0.3', 'envoy==0.0.3', 'PyHamcrest==2.0.2', 'pytest==6.2.5', 'requests==2.26.0'],
classifiers=[
_c2('Development Status', '4 - Beta'),
_c2('Environment', 'Console'),
_c2('Intended Audience', 'End Users/Desktop'),
_c2('Intended Audience', 'Developers'),
_c2('Natural Language', 'Russian'),
_c2('Operating System', 'MacOS'),
_c2('Operating System', 'POSIX', 'Linux'),
_c2('Programming Language', 'Python'),
_c2('Programming Language', 'Python', '3', 'Only'),
_c2('Programming Language', 'Python', '3.8'),
_c2('Programming Language', 'Python', '3.9'),
_c2('Programming Language', 'Python', '3.10'),
_c2('Programming Language', 'Python', '3.11'),
_c2('Programming Language', 'Python', '3.12'),
_c2('Programming Language', 'Python', '3.13'),
_c2('Programming Language', 'Python', 'Implementation'),
_c2('Programming Language', 'Python', 'Implementation', 'CPython'),
_c2('Programming Language', 'Python', 'Implementation', 'PyPy'),
_c2('Topic', 'Database'),
_c2('Topic', 'Database', 'Database Engines/Servers'),
_c2('Topic', 'Software Development'),
_c2('Topic', 'Software Development', 'Libraries'),
_c2('Topic', 'Software Development', 'Libraries', 'Python Modules'),
_c2('Topic', 'Software Development', 'Libraries', 'Application Frameworks'),
],
platforms=['ALT Linux', 'RED OS', 'Astra Linux', 'Ubuntu', 'MacOS'],
)