-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
224 lines (196 loc) · 6.58 KB
/
pyproject.toml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
[build-system]
requires = ["setuptools>=42", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[project]
name = "cs_tools"
dynamic = ["version"]
description = "Scale your ThoughtSpot adoption with tools created by the ThoughtSpot Solutions Consulting organization."
readme = "README.md"
requires-python = ">= 3.9"
license = {file = "LICENSE"}
authors = [
{name = "boonhapus", email="nicholas.cooper@thoughtspot.com"},
{name = "billdback-ts", email="bill.back@thoughtspot.com"},
{name = "devinmcpherson-ts", email="devin.mcpherson@thoughtspot.com"},
{name = "mishathoughtspot", email="misha.beek@thoughtspot.com"},
]
maintainers = [
{name = "boonhapus", email="nicholas.cooper@thoughtspot.com"},
]
classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Operating System :: OS Independent",
"License :: Other/Proprietary License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
# dependencies here are listed for cs_tools the library (ie. import cs_tools)
"pip >= 23.1",
"thoughtspot_tml",
"awesomeversion",
"httpx >= 0.27.0",
"pydantic >= 2.6.4",
"pydantic-settings",
"email-validator",
"pendulum >= 3.0.0",
"rich >= 13.7.1",
"sqlmodel >= 0.0.16",
"toml",
"packaging",
# TODO: https://github.com/thoughtspot/thoughtspot_tml/issues/24
"betterproto[compiler] == 2.0.0b6",
# version specific
"strenum >= 0.4.9; python_version < '3.11.0'",
]
[project.urls]
homepage = "https://thoughtspot.github.io/cs_tools/"
repository = "https://github.com/thoughtspot/cs_tools"
bug_tracker = "https://github.com/thoughtspot/cs_tools/issues"
documentation = "https://thoughtspot.github.io/cs_tools/"
[project.optional-dependencies]
cli = [
# pin these dependencies explicitly so we can ensure they work across environments
#
# DEV NOTE @boonhapus 2023/01/14
# these are only the direct dependencies, NOT the transitive dependencies.. so we
# need an extra process to grab the grandchild dependencies so our direct reliance
# doesn't break when a child updates.
#
# platform-specific
"pyreadline3 >= 3.4.1 ; sys_platform == 'win32'",
# CLI
"prompt_toolkit >= 3.0.47",
"typer >= 0.12.0",
# WEB
"litestar >= 2.7.0",
# TO REPLACE WITH LITESTAR
"uvicorn >= 0.29.0",
"fastapi >= 0.110.0",
]
dev = [
# CS Tools CLI
"cs_tools[cli]",
# Code Quality
"pre-commit",
"taskipy",
"ruff",
"mypy",
"vulture",
# Testing
"nox",
"pytest",
"coverage[toml]",
]
docs = [
"cs_tools[cli]",
"mkdocs-material",
# Plugins..
"mkdocs-redirects",
"mkdocs-glightbox",
"mkdocs-open-in-new-tab",
]
[project.scripts]
cs_tools = "cs_tools.cli.commands.main:run"
cstools = "cs_tools.cli.commands.main:run"
[tool.setuptools.dynamic]
version = {attr = "cs_tools.__project__.__version__"}
[tool.mypy]
plugins = [
"pydantic.mypy"
]
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
check_untyped_defs = true
strict_equality = true
strict_concatenate = true
[tool.ruff]
line-length = 120
src = ["cs_tools", "tests"]
exclude = [
"__pycache__", # ignore compiled bytecode
".venv*", # ignore virtual environments
".nox", # ignore virtual environments
# project specific ignores
"__init__.py", # ignore __init__.py
"__project__.py", # ignore project metadata
"_compat.py", # ignore compatibles
"const.py", # ignore constants
"_bootstrapper.py", # ignore bootstrapper
"noxfile.py",
"setup.py",
]
[tool.ruff.lint]
select = [
"A", # flake8-builtins: https://pypi.org/project/flake8-builtins/
"ARG", # flake8-unused-arguments: https://pypi.org/project/flake8-unused-arguments/
"B", # flake8-bugbear: https://pypi.org/project/flake8-bugbear/
"C4", # flake8-comprehensions: https://pypi.org/project/flake8-comprehensions/
"COM", # flake8-commas: https://pypi.org/project/flake8-commas/
"DTZ", # flake8-datetimez: https://pypi.org/project/flake8-datetimez/
"E", # pycodestyle: https://pypi.org/project/pycodestyle/
"F", # pyflakes: https://pypi.org/project/pyflakes/
"FA", # flake8-future-annotations: https://pypi.org/project/flake8-future-annotations/
"I", # isort: https://pypi.org/project/isort/
"Q", # flake8-quotes: https://pypi.org/project/flake8-quotes/
"RUF", # ruff-specific: https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf
"T20", # flake8-print: https://pypi.org/project/flake8-print/
"TCH", # flake8-type-checking: https://pypi.org/project/flake8-type-checking/
]
ignore = [
"B008", # Checks for function calls in default function arguments.
"COM812", # Checks for the absence of trailing commas.
"TCH001", # Moves imports into the TYPE_CHECKING block, hurting Pydantic, SQLModel
"TCH002", # Moves imports into the TYPE_CHECKING block, hurting Pydantic, SQLModel
"TCH003", # Moves imports into the TYPE_CHECKING block, hurting Pydantic, SQLModel
]
[tool.ruff.lint.flake8-import-conventions.aliases]
# Declare the default aliases.
datetime = "dt"
sqlalchemy = "sa"
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = [
"cs_tools.datastructures._GlobalModel",
"cs_tools.datastructures._GlobalSettings",
"cs_tools.datastructures.ValidatedSQLModel",
"typer.params.Option",
"typer.params.Argument",
"pydantic.BaseModel",
"pydantic_settings.BaseSettings",
"sqlalchemy.orm.DeclarativeBase",
"sqlmodel.SQLModel",
]
[tool.ruff.lint.isort]
combine-as-imports = true
force-wrap-aliases = true
from-first = true
required-imports = ["from __future__ import annotations"]
[tool.taskipy.tasks]
develop = "python -m pip install -e .[dev,docs]"
lint = "task lint_dead && lint_check && task lint_format"
lint_dead = "vulture --min-confidence 100"
lint_check = "ruff check --config pyproject.toml"
lint_format = "ruff format --config pyproject.toml"
docs_local = "mkdocs serve"
[tool.vulture]
paths = ["cs_tools"]
# [tool.coverage.run]
# branch = true
# include = [
# "cs_tools/**.py",
# ]
# [tool.coverage.report]
# exclude_lines = [
# "# pragma: no cover",
# "# pragma: peephole optimzer",
# "raise NotImplementedError",
# "if __name__ == .__main__.:",
# "if TYPE_CHECKING:",
# "if typing.TYPE_CHECKING:",
# ]