-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
129 lines (115 loc) · 4.14 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
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
authors = ["Frederik Peter Aalund <fpa@sbtinstruments.com>"]
description = "SBT Instruments' framework for Python-based applications"
license = "MIT"
name = "cyto"
readme = "README.md"
repository = "https://github.com/sbtinstruments/cyto"
version = "0.0.0" # TODO: Get version from git
[tool.poetry.dependencies]
python = ">=3.12,<4.0"
# Make sure that all dependencies are optional!
# This allows our users to opt-in via "extras".
anyio = { version = "^4.4.0", optional = true }
networkx = { version = "^3.3", optional = true }
pydantic = { version = "^2.9.2", optional = true }
pydantic-settings = { version = "^2.4.0", optional = true }
redis = { version = "^5.0.8", optional = true }
syslog-rfc5424-formatter = { version = "^1.2.3", optional = true }
portion = { version = "^2.4.2", optional = true }
tinydb = { version = "^4.8.0", optional = true }
sqlalchemy = { version = "^2.0.35", optional = true }
[tool.poetry.group.dev.dependencies]
pyfakefs = "^5.6.0"
pytest = "^8.3.2"
pytest-cov = "^5.0.0"
taskipy = "^1.13.0"
pre-commit = "^3.8.0"
ruff = "^0.6.1"
mypy = "^1.13.0"
[tool.poetry.extras]
"app" = ["anyio", "pydantic", "pydantic-settings"]
"cytio" = ["anyio"]
"cytio-tree" = ["anyio", "networkx", "pydantic"]
"cytio-tree-outline-redis" = ["anyio", "networkx", "pydantic", "redis"]
"factory" = ["pydantic"]
"interval" = ["portion", "pydantic"]
"logging-rfc5424" = ["syslog-rfc5424-formatter"]
"model" = ["pydantic"]
"settings" = ["pydantic", "pydantic-settings"]
"stout" = ["portion", "pydantic", "tinydb"]
"db" = ["sqlalchemy", "pydantic"]
[tool.taskipy.tasks]
ruff = "ruff check cyto tests"
mypy = "mypy cyto tests"
pre-commit = "pre-commit run --all-files"
[tool.pytest.ini_options]
testpaths = 'tests'
[tool.ruff]
target-version = "py312"
line-length = 88
lint.select = ["ALL"]
lint.ignore = [
# "flake8-annotations". mypy does our type checking.
"ANN",
# "flake8-commas (COM)". We use black instead.
"COM",
# "flake8-errmsg (EM)". Three rules that are all about "Exception must not use
# a string literal, assign to variable first". Too little gained for the effort.
# Maybe later.
"EM",
# "Boolean default value in function definition". We think it's perfectly okay to
# provide a default value for a boolean flag.
"FBT002",
# "pydocstyle (D)". We *should* do this. It's just a large effort. Maybe later.
"D",
# Allow ourselves to just import stuff in __init__ files.
"F401",
# "Use of assert detected". We like `assert`.
"S101",
# "flake8-type-checking". Too little gained for the effort. Maybe later.
"TCH",
# We have TODO's and HACK's throughout as reminders for later. That is okay.
"FIX002",
"FIX004",
# "TD002 Missing author in TODO".
# "TD003 Missing issue link on the line following this TODO".
# That's not how we use TODO.
"TD002",
"TD003",
# "Relative imports from parent modules are banned". We like relative imports.
"TID252",
# ISC001 conflicts with ruff's own, built-in formatter.
'ISC001',
# "Avoid specifying long messages outside the exception class".
# Apparently, any string that contains a space is "too long". That's a bit too
# strict for us.
"TRY003",
# We prefer a combination of `error` and debug` to log the error message and
# exception (including stack trace), respectively. We do *not* want to use
# `exception` since it outputs both at the ERROR log level.
"TRY400",
]
[tool.mypy]
strict = true
no_implicit_reexport = false # Enabled by "strict = true"
show_error_codes = true
plugins = ["pydantic.mypy"]
# Unfortunately, this does not work for top-level ignores.
# See: https://github.com/python/mypy/issues/12076
warn_unused_ignores = false
[[tool.mypy.overrides]]
module = "redis.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["networkx.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["portion.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["syslog_rfc5424_formatter.*"]
ignore_missing_imports = true