-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
114 lines (97 loc) · 4.03 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
from __future__ import annotations
import os
from pathlib import Path
from setuptools import find_packages, setup
here = Path(__file__).parent.resolve()
def get_version():
if os.getenv("GITHUB_REF_TYPE", "branch") == "tag":
return os.environ["GITHUB_REF_NAME"]
version_file = here / "onetl" / "VERSION"
version = version_file.read_text().strip()
build_num = os.getenv("GITHUB_RUN_ID", "0")
branch_name = os.getenv("GITHUB_REF_NAME", "")
if not branch_name:
return version
return f"{version}.dev{build_num}"
def parse_requirements(file: Path) -> list[str]:
lines = file.read_text().splitlines()
return [line.rstrip() for line in lines if line and not line.startswith("#")]
requirements_core = parse_requirements(here / "requirements" / "core.txt")
requirements_ftp = parse_requirements(here / "requirements" / "ftp.txt")
requirements_sftp = parse_requirements(here / "requirements" / "sftp.txt")
requirements_samba = parse_requirements(here / "requirements" / "samba.txt")
requirements_hdfs = parse_requirements(here / "requirements" / "hdfs.txt")
requirements_s3 = parse_requirements(here / "requirements" / "s3.txt")
requirements_webdav = parse_requirements(here / "requirements" / "webdav.txt")
requirements_files = [
*requirements_ftp,
*requirements_sftp,
*requirements_hdfs,
*requirements_s3,
*requirements_webdav,
*requirements_samba,
]
requirements_kerberos = parse_requirements(here / "requirements" / "kerberos.txt")
requirements_spark = parse_requirements(here / "requirements" / "spark.txt")
requirements_all = [*requirements_files, *requirements_kerberos, *requirements_spark]
long_description = (here / "README.rst").read_text()
setup(
name="onetl",
version=get_version(),
author="DataOps.ETL",
author_email="[email protected]",
description="One ETL tool to rule them all",
long_description=long_description,
long_description_content_type="text/x-rst",
license="Apache-2.0",
license_files=("LICENSE.txt",),
url="https://github.com/MobileTeleSystems/onetl",
classifiers=[
"Development Status :: 4 - Beta",
"Framework :: Pydantic",
"Framework :: Pydantic :: 1",
"Framework :: Pydantic :: 2",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"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",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Java Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Distributed Computing",
"Typing :: Typed",
],
project_urls={
"Documentation": "https://onetl.readthedocs.io/",
"Source": "https://github.com/MobileTeleSystems/onetl",
"CI/CD": "https://github.com/MobileTeleSystems/onetl/actions",
"Tracker": "https://github.com/MobileTeleSystems/onetl/issues",
},
keywords=["Spark", "ETL", "JDBC", "HWM"],
packages=find_packages(exclude=["docs", "docs.*", "tests", "tests.*"]),
entry_points={"tricoder_package_spy.register": ["onetl=onetl"]},
python_requires=">=3.7",
install_requires=requirements_core,
extras_require={
"spark": requirements_spark,
"ftp": requirements_ftp,
"ftps": requirements_ftp,
"sftp": requirements_sftp,
"samba": requirements_samba,
"hdfs": requirements_hdfs,
"s3": requirements_s3,
"webdav": requirements_webdav,
"files": requirements_files,
"kerberos": requirements_kerberos,
"all": requirements_all,
},
include_package_data=True,
zip_safe=False,
)