Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
153 lines (135 loc) · 4.49 KB
/
Copy pathpyproject.toml
File metadata and controls
153 lines (135 loc) · 4.49 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
[project]
name = "morphir-workspace"
version = "0.0.1"
description = "Development workspace for the Morphir library and CLI"
requires-python = ">=3.14"
readme = "README.md"
license = "Apache-2.0"
[dependency-groups]
dev = [
"ruff>=0.8",
"mypy>=1.13",
"pyright>=1.1",
"pre-commit>=4.0",
]
test = [
"pytest>=8.0",
"pytest-cov>=6.0",
"behave>=1.2",
"coverage>=7.0",
]
[tool.uv]
managed = true
[tool.uv.workspace]
members = ["packages/morphir", "packages/morphir-python-native", "packages/morphir-tools"]
[tool.uv.sources]
morphir = { workspace = true }
morphir-python-native = { workspace = true }
# =============================================================================
# Ruff Configuration
# =============================================================================
[tool.ruff]
target-version = "py314"
line-length = 88
# rust/ holds compiler test inputs whose exact text is part of the tests.
exclude = [".venv", "build", "dist", ".git", "__pycache__", "rust"]
[tool.ruff.lint]
select = [
"E", "W", # pycodestyle
"F", # Pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"RUF", # Ruff-specific
"D", # pydocstyle
]
ignore = [
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = ["D101", "D102", "D103", "E501"]
# The benchmark report embeds the HTML document template's long head lines.
"scripts/bench.py" = ["E501"]
# Compiler input: the supported subset has no TYPE_CHECKING blocks.
"tests/fixtures/python/**/*" = ["TC001", "TC003"]
"examples/model/**/*" = ["TC001", "TC003", "D101", "D103"]
"packages/morphir/src/morphir/ir/**/*.py" = ["D101", "D102", "D103", "UP006", "UP007", "UP035", "UP037", "UP046", "TC001", "TC003", "E501", "C408", "RUF005", "E402"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-first-party = ["morphir", "morphir_tools", "morphir_python_native"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
# =============================================================================
# Mypy Configuration
# =============================================================================
[tool.mypy]
python_version = "3.14"
strict = true
warn_unreachable = true
pretty = true
show_error_codes = true
show_column_numbers = true
namespace_packages = true
explicit_package_bases = true
mypy_path = ["packages/morphir/src", "packages/morphir-tools/src", "packages/morphir-python-native/python"]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
[[tool.mypy.overrides]]
module = "features.*"
ignore_errors = true
# =============================================================================
# Pyright Configuration
# =============================================================================
[tool.pyright]
pythonVersion = "3.14"
typeCheckingMode = "standard"
reportMissingImports = true
reportMissingTypeStubs = false
include = ["packages/morphir/src", "packages/morphir-tools/src", "packages/morphir-python-native/python", "scripts", "tests"]
exclude = ["**/__pycache__", ".venv", "build", "dist"]
# =============================================================================
# Pytest Configuration
# =============================================================================
[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
filterwarnings = [
"error",
"ignore::DeprecationWarning",
]
# =============================================================================
# Coverage Configuration
# =============================================================================
[tool.coverage.run]
source = ["packages/morphir/src", "packages/morphir-tools/src"]
branch = true
omit = ["*/tests/*", "*/__pycache__/*", "*/.venv/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@abstractmethod",
"@overload",
"raise NotImplementedError",
]
fail_under = 80
show_missing = true
skip_covered = true
[tool.coverage.html]
directory = "htmlcov"