-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
232 lines (195 loc) · 6.58 KB
/
Copy pathpyproject.toml
File metadata and controls
232 lines (195 loc) · 6.58 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
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
225
226
227
228
229
230
231
232
[project]
name = "prusa-connect-sdk-client"
description = "Unoriginal Prusa Connect API client for Python and CLI"
readme = "README.md"
authors = [
{ name = "Derek Ditch", email = "dcode@users.noreply.github.com"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
]
keywords = [
"prusa",
"connect",
"api",
"client",
"3d-printing",
"iot",
"sdk"
]
dynamic = ["version"]
requires-python = ">=3.12"
dependencies = [
"requests>=2.32.5",
"structlog>=25.5.0",
"pydantic>=2.0.0",
"platformdirs>=4.0.0",
"python-socketio>=5.16.1",
"protobuf>=6.33.5",
]
[project.license]
text = "AGPL-3.0-or-later"
[project.urls]
Documentation = "https://dcode.github.io/python-prusa-connect-sdk-client/"
Homepage = "https://dcode.github.io/python-prusa-connect-sdk-client/"
Issues = "https://github.com/dcode/python-prusa-connect-sdk-client/issues"
Repository = "https://github.com/dcode/python-prusa-connect-sdk-client"
[project.optional-dependencies]
all = [
"prusa-connect-sdk-client[cli]",
]
# Users must run: pip install "prusa-connect-sdk-client[cli]"
cli = [
"cyclopts>=2.0.0",
"rich>=14.3.1",
"better-exceptions>=0.3.3",
"pydantic-settings>=2.2.0",
]
[project.scripts]
prusactl = "prusa.connect.client.cli.main:main"
[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"
default = true
[tool.uv.sources]
# Temporary workaround until PR #63 upstream is merged and released
essentials-openapi = { git = "https://github.com/dcode/essentials-openapi", branch = "main" }
[build-system]
requires = ["hatchling", "hatch-protobuf", "mypy-protobuf"]
build-backend = "hatchling.build"
[dependency-groups]
dev = [
"hatch>=1.16.3",
"hatch-protobuf>=0.5.0",
"grpcio==1.80.0", # force downgrade due to "https://github.com/grpc/grpc/issues/41725"
"grpcio-tools==1.80.0", # force downgrade due to "https://github.com/grpc/grpc/issues/41725"
"mdformat-gfm>=1.0.0",
"mdformat-ruff>=0.1.3",
"mypy-protobuf>=5.0.0",
"pre-commit>=4.5.1",
"pymarkdownlnt>=0.9.35",
"pyrefly>=0.50.1",
"pytest>=9.0.2",
"pytest-deepassert>=0.3.0",
"responses>=0.25.8",
"ruff>=0.14.14",
]
docs = [
"cyclopts[mkdocs]>=4.5.1",
"hatch-mkdocs>=0.1.0",
"markdown-callouts>=0.4.0",
"markdown-gfm-admonition>=0.3.0",
"mdformat>=1.0.0",
"mdformat-mkdocs[recommended]>=5.1.4",
"mkdocs-autorefs>=1.4.3",
"mkdocs-git-committers-plugin-2>=2.5.0",
"mkdocs-git-revision-date-localized-plugin>=1.5.1",
"mkdocs-material[imaging,recommended]>=9.7.1",
"mkdocstrings[python]>=1.0.3",
"neoteroi-mkdocs>=1.2.0",
"essentials-openapi @ git+https://github.com/dcode/essentials-openapi@main",
"pymdown-extensions>=10.20.1",
]
[tool.hatch.version]
path = "src/prusa/connect/client/__version__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/prusa"]
[tool.hatch.envs.default]
installer = "uv"
env-vars = { "UV_DEFAULT_INDEX" = "https://pypi.org/simple" }
features = ["cli"]
[tool.hatch.build.hooks.protobuf]
dependencies = ["hatch-protobuf", "mypy-protobuf"]
proto_paths = ["proto"]
output_path = "src"
generate_grpc = false
generate_pyi = false
[[tool.hatch.build.hooks.protobuf.generators]]
name = "mypy"
outputs = ["{proto_path}/{proto_name}_pb2.pyi"]
################################################################################
# Static Analysis (Linting & Formatting)
################################################################################
[tool.hatch.envs.hatch-static-analysis]
dependencies = ["ruff>=0.14.14"]
[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
select = ["F", "E", "W", "I", "N", "D", "UP", "B", "A", "C4", "SIM", "TC", "RUF"]
ignore = ["D203", "D213"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
known-first-party = ["prusa.connect.client"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D100","D101", "D102", "D103", "S101"]
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-decorators = ["*app.command", "*app.default"]
################################################################################
# Type Checking
################################################################################
[tool.hatch.envs.typing]
features = ["cli"]
dependency-groups = ["dev", "docs"]
[tool.hatch.envs.typing.scripts]
check = "uv run pyrefly check ."
[tool.pyrefly]
project-includes = ["**/*.py*"]
ignore-errors-in-generated-code = true
################################################################################
# Testing
################################################################################
[tool.hatch.envs.hatch-test]
features = ["cli"]
dependencies = [
"pytest",
"pytest-cov",
"pytest-deepassert",
"pyrefly",
"responses",
"ruff",
]
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.12", "3.14"]
[tool.hatch.envs.hatch-test.overrides]
matrix.cli.features = ["cli"]
[tool.pytest.ini_options]
addopts = [
"--deepassert",
"--import-mode=importlib",
]
[tool.coverage]
run.branch = true
run.omit = ["tests/*"]
report.omit = ["tests/*"]
report.exclude_also = ["if TYPE_CHECKING:"]
################################################################################
# Documentation Lint & Build
################################################################################
[tool.hatch.envs.docs]
features = ["cli"]
dependency-groups = ["dev", "docs"]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build -f mkdocs.yml {args}"
serve = "mkdocs serve -f mkdocs.yml {args}"
gh-deploy = "mkdocs gh-deploy -f mkdocs.yml {args}"
[tool.pymarkdown]
extensions.front-matter.enabled = true
extensions.front-matter.enabled-by-default = true
plugins.md002.enabled = false
plugins.md022.enabled = false
plugins.md013.enabled = false # Let mdformat handle line wrapping
plugins.md033.enabled = false # Allow inline HTML for MkDocs
plugins.md041.enabled = false # First line in file does not always have to be a top level heading
plugins.md024.enabled = false # Allow duplicate headings in different sections
plugins.md007.enabled = false # Let mdformat handle list indentation
plugins.md046.enabled = false # mdformat does this properly anyway, disabling stops mkdocs admonitions from throwing false positives