-
Notifications
You must be signed in to change notification settings - Fork 112
/
setup.py
76 lines (65 loc) · 2.39 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
#!/usr/bin/env python
import os
import re
from setuptools import find_namespace_packages, setup
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md')) as f:
long_description = f.read()
# get this from a separate file
def _dbt_clickhouse_version():
_version_path = os.path.join(this_directory, 'dbt', 'adapters', 'clickhouse', '__version__.py')
_version_pattern = r'''version\s*=\s*["'](.+)["']'''
with open(_version_path) as f:
match = re.search(_version_pattern, f.read().strip())
if match is None:
raise ValueError(f'invalid version at {_version_path}')
return match.group(1)
package_name = 'dbt-clickhouse'
package_version = _dbt_clickhouse_version()
description = '''The Clickhouse plugin for dbt (data build tool)'''
dbt_version = '1.8.0'
dbt_minor = '.'.join(dbt_version.split('.')[0:2])
if not package_version.startswith(dbt_minor):
raise ValueError(
f'Invalid setup.py: package_version={package_version} must start with '
f'dbt_version={dbt_minor}'
)
setup(
name=package_name,
version=package_version,
description=description,
long_description=long_description,
long_description_content_type='text/markdown',
author='ClickHouse Inc.',
author_email='[email protected]',
url='https://github.com/ClickHouse/dbt-clickhouse',
license='MIT',
packages=find_namespace_packages(include=['dbt', 'dbt.*']),
package_data={
'dbt': [
'include/clickhouse/dbt_project.yml',
'include/clickhouse/macros/*.sql',
'include/clickhouse/macros/**/*.sql',
]
},
install_requires=[
f'dbt-core~={dbt_version}',
'clickhouse-connect>=0.6.22',
'clickhouse-driver>=0.2.6',
'setuptools>=0.69',
],
python_requires=">=3.8",
platforms='any',
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
)