-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
116 lines (102 loc) · 2.71 KB
/
Copy pathsetup.py
File metadata and controls
116 lines (102 loc) · 2.71 KB
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
116
"""Setup script for package."""
# pylint: disable=consider-using-with, no-self-use
import os
import re
import sys
from pathlib import Path
from setuptools import Command, find_packages, setup
match = re.search(
r'^VERSION\s*=\s*"(.*)"',
Path("offerexpert/version.py").read_text(encoding="UTF-8"),
re.M,
)
VERSION = match.group(1) if match else "???"
LONG_DESCRIPTION = Path("README.md").read_text(encoding="UTF-8")
class VerifyVersion(Command):
"""Command for verifying that git tag matches package version."""
description = "verify that the git tag matches package version"
user_options = []
def initialize_options(self):
"""Implement required method for Command."""
def finalize_options(self):
"""Implement required method for Command."""
def run(self):
"""
Check that the git tag matches the package version.
If it doesn't match, exit.
"""
tag = os.getenv("CIRCLE_TAG")
if not _validate_version(tag, VERSION):
info = f"Git tag: '{tag}' does not match package version: {VERSION}" # noqa: E501
sys.exit(info)
def _validate_version(tag: str | None, version: str) -> bool:
if not tag:
return version == "0.0.0"
if tag[0] != "v":
return False
return tag[1:] == version
setup(
name="OfferXpert",
version=VERSION,
description="",
long_description=LONG_DESCRIPTION,
author="Apdullah Yayik",
author_email="apdullahyayik@gmail.com",
url="",
keywords="",
packages=find_packages(),
install_requires=[
"transformers",
"torch",
"pandas",
"sentence-transformers",
"faiss-cpu",
"gensim",
"matplotlib",
"nltk",
"regex",
"seaborn",
"scikit-learn",
"torch",
"tqdm",
"pytest",
],
extras_require={
"dev": [
"bandit",
"black",
"coverage",
"flake8-annotations",
"flake8-plus",
"flake8-pytest-style",
"flake8",
"jupyter",
"lxml-stubs",
"pycodestyle",
"pydocstyle",
"pyenchant",
"pylint",
"pytest-cov",
"pytest-mock",
"pytest",
"rope",
"tox",
],
"test": [
"coverage",
"pytest",
"pytest-cov",
"pytest-mock",
"tox",
],
},
classifiers=["Programming Language :: Python :: 3.10"],
entry_points={
"console_scripts": [
"offerexpert = offerexpert.__main__:main",
]
},
cmdclass={
"verify": VerifyVersion,
},
)