forked from dbt-labs/dbt-athena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
77 lines (65 loc) · 2.63 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
#!/usr/bin/env python
import os
import re
from typing import Any, Dict
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"), encoding="utf-8") as f:
long_description = f.read()
package_name = "dbt-athena-community"
# get version from a separate file
def _get_plugin_version_dict() -> Dict[str, Any]:
_version_path = os.path.join(this_directory, "dbt", "adapters", "athena", "__version__.py")
_semver = r"""(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)"""
_pre = r"""((?P<prekind>a|b|rc)(?P<pre>\d+))?"""
_version_pattern = rf"""version\s*=\s*["']{_semver}{_pre}["']"""
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.groupdict()
def _get_package_version() -> str:
parts = _get_plugin_version_dict()
version = "{major}.{minor}.{patch}".format(**parts)
if parts["prekind"] and parts["pre"]:
version += parts["prekind"] + parts["pre"]
return version
description = "The athena adapter plugin for dbt (data build tool)"
setup(
name=package_name,
version=_get_package_version(),
description=description,
long_description=long_description,
long_description_content_type="text/markdown",
platforms="any",
license="Apache License 2.0",
license_files=("LICENSE.txt",),
url="https://github.com/dbt-athena/dbt-athena",
packages=find_namespace_packages(include=["dbt", "dbt.*"]),
include_package_data=True,
install_requires=[
"dbt-common>=1.0.0b2,<2.0",
"dbt-adapters>=1.0.0b2,<2.0",
# add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency
"dbt-core>=1.8.0",
"boto3>=1.28",
"boto3-stubs[athena,glue,lakeformation,sts]>=1.28",
"pyathena>=2.25,<4.0",
"mmh3>=4.0.1,<4.2.0",
"pydantic>=1.10,<3.0",
"tenacity>=8.2,<10.0",
],
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",
],
python_requires=">=3.8,<3.13",
)