-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
159 lines (136 loc) · 6.12 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
[build-system]
requires = [
"poetry-core>=1.7.0",
"poetry-dynamic-versioning>=1.0.0,<2.0.0",
]
build-backend = "poetry_dynamic_versioning.backend"
[tool.poetry]
name = "clive"
version = "0.0.0"
description = "CLI application for interacting with the Hive blockchain."
readme = "README.md"
repository = "https://gitlab.syncad.com/hive/clive"
authors = [
"Mateusz Żebrak <mzebrak@syncad.com>",
"Krzysztof Mochocki <kmochocki@syncad.com>"
]
packages = [
{ include = "clive" },
]
include = [
"settings.toml",
]
source = [
{ name = "PyPI", priority = "primary" },
{ name = "gitlab-schemas", url = "https://gitlab.syncad.com/api/v4/projects/362/packages/pypi/simple", priority = "supplemental" },
{ name = "gitlab-wax", url = "https://gitlab.syncad.com/api/v4/projects/419/packages/pypi/simple", priority = "supplemental" },
{ name = "gitlab-helpy", url = "https://gitlab.syncad.com/api/v4/projects/434/packages/pypi/simple", priority = "supplemental" },
]
[tool.poetry.dependencies]
python = "^3.10"
dynaconf = "3.1.11"
loguru = "0.7.2"
textual = "0.83.0"
aiohttp = "3.9.1"
pydantic = "1.10.18"
typer = { extras = ["all"], version = "0.9.0" }
inflection = "0.5.1"
humanize = "4.6.0"
wax = "0.3.10.dev102+32ca5ac"
schemas = "0.0.1.dev310+c0550c1"
[tool.poetry.group.embeddedtestnet.dependencies]
clive-local-tools = { path = "tests/clive-local-tools", develop = true }
test-tools = { path = "hive/tests/python/hive-local-tools/test-tools" }
pytest = "7.2.0" # required by test-tools, otherwise they will fail
[tool.poetry.group.dev.dependencies]
mypy = "1.11.2"
pre-commit = "2.21.0"
pytest = "7.2.0"
pytest-asyncio = "0.21.0"
pytest-xdist = "3.1.0"
pytest-timeout = "2.3.1"
ruff = "0.6.5"
types-pyyaml = "6.0.12.4"
textual-dev = "1.5.1"
clive-local-tools = { path = "tests/clive-local-tools", develop = true }
test-tools = { path = "hive/tests/python/hive-local-tools/test-tools", develop = true }
[tool.poetry.scripts]
clive = "clive.main:main"
clive-dev = "clive.dev:main"
[tool.poetry-dynamic-versioning]
enable = true
format-jinja = """
{%- set dirty_postfix = '.dirty' if dirty else '' -%}
{%- if distance == 0 and not dirty -%}
{{ serialize_pep440(base, stage, revision) }}
{%- elif revision is not none -%}
{{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }}{{ dirty_postfix }}
{%- else -%}
{{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }}{{ dirty_postfix }}
{%- endif -%}
"""
[tool.poetry-dynamic-versioning.substitution]
files = [
"clive/__init__.py",
]
[tool.mypy]
strict = true
disallow_untyped_decorators = false
plugins = "pydantic.mypy"
[[tool.mypy.overrides]]
module = ["test_tools.*"]
ignore_missing_imports = true
[tool.ruff]
line-length = 120
[tool.ruff.lint]
# https://docs.astral.sh/ruff/rules/
select = ["ALL"]
ignore = [
"D1", # missing docstring in public
"D203", # 1 blank line required before class docstring; because we re using D211
"D212", # Multi-line docstring summary should start at the first line; because we re using D213
"D413", # Missing blank line after last section
"TRY003", # Avoid specifying long messages outside the exception class; too restrictive
"ANN101", # Missing annotation for self; makes no sense
"ANN102", # Missing annotation for cls; makes no sense
"TD002", # Missing author in to-do; no need for that
"TD003", # Missing issue link on the line following this to-do; no need for that
"SLF001", # Private member accessed: {access}; too restrictive
"COM812", # Trailing comma missing; handled by ruff formatter
"EM", # agreed not to use it in our convention
"FIX", # can't have that enabled, as we treat ruff result as an error on CI
"S101", # Use of assert detected; too restrictive
"S603", # `subprocess` call: check for execution of untrusted input; https://github.com/astral-sh/ruff/issues/4045
"ISC001", # Implicitly concatenated string literals on one line; disabled because conflicts with ruff formatter
]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
[tool.ruff.lint.isort]
known-first-party = ["clive", "wax", "schemas", "clive_local_tools"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"clive/__private/cli/**" = [
"I002", # Missing required import: {name}; TODO: Causes error https://github.com/tiangolo/typer/issues/296#issuecomment-1494005853
"FA", # future annotations; TODO: related to above
"UP007", # Use X | Y for type annotations; TODO: Remove when https://github.com/tiangolo/typer/pull/548 will be merged
"B008", # Do not perform function call {name} in argument defaults; in Typer it is common to do that # TODO: should be disabled more specifically but requires restructuring typer interface (e.g. storing all typer functions in cli/interface)
]
"clive/__private/cli/common/**" = [
"RUF009", # Do not perform function call {name} in dataclass defaults; common pattern for common options
]
"clive/__private/ui/**" = [
"PLR0913", # Too many arguments in function definition; too restrictive; # TODO: could be fixed or disabled in place
"RUF012", # Mutable class attributes should be annotated with typing.ClassVar; TODO: Check if we can fix it, it's kinda Textual-specific
]
"tests/**" = [
"PT004", # fixture does not return anything, add leading underscore; issue: pytest seems to ignore (not launch) auto-use fixtures with leading underscode
"S104", # Checks for hardcoded bindings to all network interfaces (0.0.0.0); in tests this is not a security issue
"S105", # Possible hardcoded password assigned to: "{}"; in tests this is not a security issue
"S106", # Possible hardcoded password assigned to argument: "{}"; in tests this is not a security issue
"S602", # Check for method calls that initiate a subprocess with a shell.; in tests this is not a security issue
"S605", # Checks for calls that start a process with a shell, providing guidance on whether the usage is safe or not; in tests this is not a security issue
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = "--strict-markers"