-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
204 lines (180 loc) · 6.03 KB
/
pyproject.toml
File metadata and controls
204 lines (180 loc) · 6.03 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
#:tombi schema.strict = false
# SPDX-FileCopyrightText: 2025 Knitli Inc.
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
#
# SPDX-License-Identifier: MIT OR Apache-2.0
[project]
name = "exportify"
description = "Export, __all__, and lazy import management for Python projects."
readme = "README.md"
requires-python = ">=3.12"
license-files = ["LICENSE-Apache-2.0", "LICENSE-MIT", "LICENSES/*"]
authors = [
{ name = "Knitli Inc." },
{ name = "Adam Poulemanos", email = "adam@knit.li" },
]
keywords = [
"__all__",
"__init__",
"code-generation",
"exports",
"lazy-imports",
"package-management"
]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"cyclopts>=4.8.0",
"lateimport>=0.1.0",
"pyyaml>=6.0.3",
"rich>=14.3.0",
"textcase>=0.4.5"
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/knitli/exportify"
Issues = "https://github.com/knitli/exportify/issues"
Repository = "https://github.com/knitli/exportify"
[project.scripts]
exportify = "exportify.cli:main"
[dependency-groups]
dev = [
"pytest>=9.0.0",
"pytest-cov>=7.0.0",
"pytest-env>=1.5.0",
"pytest-mock>=3.15.1",
"ruff>=0.15.5",
"ty>=0.0.21",
"uv>=0.10.9"
]
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.coverage.run]
omit = [
"src/exportify/__init__.py",
"src/exportify/_version.py",
"src/exportify/types.py",
]
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.hatch.build.hooks.version]
additionalProperties = true
path = "src/exportify/_version.py"
# The reuse statements prevent REUSE from considering this snippet for license compliance, which would error
# REUSE-IgnoreStart
template = '''# SPDX-FileCopyrightText: 2026 Knitli Inc.
# SPDX-License-Identifier: MIT OR Apache-2.0
"""Version information for Exportify."""
from typing import Final
__version__: Final[str] = "{version}"
__all__ = ("__version__",)
'''
# REUSE-IgnoreEnd
[tool.hatch.build.targets.wheel]
artifacts = ["src/**", "README.md", "LICENSES/*"]
[tool.hatch.build.targets.sdist]
include = [
"src/**",
"README.md",
"LICENSES/*",
]
exclude = [
".claude/**",
".roo/**",
".serena/**",
".specify/**",
".vscode/**",
"claudedocs/**",
"data/**",
"docker/**",
"docs-site/**",
"mise-tasks/**",
"overrides/**",
"plans/**",
"scripts/**",
"specs/**",
]
[tool.pytest]
addopts = [
"--cov-fail-under=80",
"--cov-report=html",
"--cov-report=term-missing",
"--cov=exportify",
"--import-mode=importlib",
"-ra",
"-v",
]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::UserWarning",
]
minversion = "9.0"
python_classes = ["Test*"]
python_files = ["*_test.py", "test_*.py"]
python_functions = ["test_*"]
pythonpath = ["./src"]
testpaths = ["tests"]
[tool.ty.environment]
python-version = "3.12"
root = ["./src", "./tests"]
python = "./.venv"
[tool.ty.rules]
# === Core Type Safety Rules (kept strict for src/) ===
# These remain as errors by default and will catch real bugs in production code
# === Test Framework Limitations ===
# ty doesn't understand pytest mocks/fixtures - these are inherent limitations, not real bugs
possibly-missing-attribute = "ignore" # Pytest fixtures don't have static attributes
unresolved-attribute = "warn" # Test mocks may have dynamic attributes
unknown-argument = "warn" # Pytest fixtures injected dynamically
unresolved-reference = "warn" # Test references may be dynamic
# === Type Inference Limitations ===
# ty is overly strict with Literal inference in dict lookups and dynamic patterns
invalid-argument-type = "warn" # Many false positives in capabilities dicts and code gen
missing-typed-dict-key = "warn" # Often false positive with dynamic TypedDict construction (e.g., **dict comprehension)
# === Style and Refactoring Suggestions ===
redundant-cast = "ignore" # Informational only, not bugs
# === Optional Dependencies ===
# Scripts may import optional dependencies (e.g., mkdocs_gen_files, black)
unresolved-import = "warn" # Downgrade to warn for optional dependencies
[tool.ty.src]
include = ["./src", "./tests", "./scripts", "./mise-tasks", "./packages"]
# Exclude vendored code, typings, and intentionally malformed test fixtures
exclude = ["./typings", "./tests/**/malformed.py", "./vendored"]
[[tool.ty.overrides]]
include = ["./src/exportify/__init__.py", "./src/exportify/*/__init__.py"]
[tool.ty.overrides.rules]
# Our version resolution strategy dynamically determines the version, but only during development.
# If the _version.py is present, ty raises `invalid-assignment` because _version.py marks __version__ as a Final[str] but the value is assigned dynamically.
# For release builds, _version.py will always exist, so it's static and compliant with the Final[str] declaration. During development, we accept that __version__ is dynamic and ignore the invalid-assignment error.
invalid-assignment = "ignore"
unresolved-attribute = "ignore" # this stems from the fact that technically __spec__.parent can return None, but in practice it won't in our __init__.py context
[[tool.ty.overrides]]
include = ["tests/test_migration.py"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore" # Many false positives in test_migration due to dynamic test patterns and complex validation logic
[tool.uv]
package = true
cache-keys = [{ file = "uv.lock" }, { file = "pyproject.toml" }]
preview = true
[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
fallback-version = "0.0.0"
bump = true
dirty = false # Disabled .dirty suffix to maintain PEP 440 compliance
# tag-branch = "main" # Commented out to allow building on feature branches
commit-prefix = "g"