-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
70 lines (53 loc) · 1.92 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
#!/usr/bin/env python
# -*- coding: utf-8 -*
import os
import pathlib
import sys
from setuptools import find_packages, setup
from setuptools.command.install import install
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
VERSION = "1.0.2"
REPO_ROOT = pathlib.Path(__file__).parent
# Fetch the long description from the readme
with open(REPO_ROOT / "README.md", encoding="utf-8") as f:
README = f.read()
class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version."""
description = "verify that the git tag matches our version"
def run(self):
tag = os.getenv("CIRCLE_TAG")
if tag != VERSION:
info = f"Git tag: {tag} does not match the version of this app: {VERSION}"
sys.exit(info)
install_requires = [
"tentaclio",
"databricks-sql-connector",
]
setup_args = dict(
name="tentaclio-databricks",
version=VERSION,
include_package_data=True,
description="A python project containing all the dependencies for the databricks+thrift tentaclio schema.",
long_description=README,
long_description_content_type="text/markdown",
author="Octopus Energy",
author_email="[email protected]",
license="Proprietary",
package_dir={"": "src"},
packages=find_packages("src", include=["*tentaclio_databricks*"]),
install_requires=install_requires,
classifiers=[
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
cmdclass={"verify": VerifyVersionCommand},
)
if __name__ == "__main__":
setup(**setup_args)