mirror of
https://github.com/diodeinc/pcb.git
synced 2026-09-14 20:17:19 +08:00
38 lines
1.4 KiB
TOML
38 lines
1.4 KiB
TOML
[project]
|
|
name = "pcb-scripts"
|
|
version = "0.0.0"
|
|
requires-python = ">=3.10"
|
|
dependencies = ["click>=8.5.0"]
|
|
|
|
[dependency-groups]
|
|
dev = ["pytest>=9.1.1", "hypothesis>=6.167.0", "ruff>=0.16.5", "ty>=0.0.75"]
|
|
|
|
[tool.ruff]
|
|
# These scripts execute inside KiCad's bundled interpreter, which is Python
|
|
# 3.9.13 as of KiCad 10 -- NOT the >=3.10 above, which only describes the uv
|
|
# dev/test environment. Without this, ruff infers py310 from requires-python and
|
|
# rewrites `Optional[X]` to PEP 604 `X | None`, which raises
|
|
# `TypeError: unsupported operand type(s) for |` at import time under KiCad.
|
|
# pytest and ty both run on 3.12 and do not catch it.
|
|
target-version = "py39"
|
|
|
|
[tool.ruff.lint]
|
|
# `required-imports` below is only enforced by I002, which is NOT part of ruff's
|
|
# default selection (that only includes I001), so it must be selected explicitly
|
|
# or the setting is silently inert.
|
|
extend-select = ["I002"]
|
|
|
|
[tool.ruff.lint.isort]
|
|
# Paired with target-version above: `from __future__ import annotations` makes
|
|
# every annotation a lazy string, so modern `list[str]` / `X | None` spellings
|
|
# are safe to write even though KiCad's interpreter is 3.9. Without it those
|
|
# spellings would be evaluated at import time and raise.
|
|
required-imports = ["from __future__ import annotations"]
|
|
|
|
[tool.ty.src]
|
|
exclude = ["**/tests/"]
|
|
|
|
[tool.ty.rules]
|
|
# Disable unresolved-import: ty can't resolve relative imports in non-package scripts
|
|
unresolved-import = "ignore"
|