-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
127 lines (110 loc) · 4.15 KB
/
pyproject.toml
File metadata and controls
127 lines (110 loc) · 4.15 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
# SPDX-FileCopyrightText: 2026 Knitli Inc.
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
#
# SPDX-License-Identifier: MIT OR Apache-2.0
#:tombi schema.strict = false
[project]
name = "lateimport"
description = "Lazy import utilities for deferred module loading and attribute access. Truly lazy, truly late."
readme = "README.md"
requires-python = ">=3.12" # We use parameterized generics, because `Generic` is ugly.
license-files = ["LICENSE-Apache-2.0", "LICENSE-MIT", "LICENSES/*"]
authors = [
{ name = "Knitli Inc." },
{ name = "Adam Poulemanos", email = "adam@knit.li" },
]
keywords = [
"attribute",
"deferred",
"import",
"lazy",
"loading",
"module",
"proxy",
"utilities",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dynamic = ["version"]
[project.urls]
Changelog = "https://github.com/knitli/lateimport/blob/main/CHANGELOG.md"
Homepage = "https://github.com/knitli/lateimport"
Issues = "https://github.com/knitli/lateimport/issues"
Repository = "https://github.com/knitli/lateimport"
[dependency-groups]
dev = [
"pytest>=9.0.0",
"pytest-cov>=7.0.0",
"pytest-mock>=3.15.1",
"ruff>=0.15.0",
]
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.hatch.build.hooks.version]
path = "src/lateimport/_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 lateimport."""
from typing import Final
__version__: Final[str] = "{version}"
__all__ = ("__version__",)
'''
# REUSE-IgnoreEnd
[tool.hatch.build.targets.wheel]
packages = ["src/lateimport"]
[tool.pytest]
markers = [
"benchmark: marks tests as benchmark/performance tests",
"performance: marks tests as performance tests",
"unit: marks tests as unit tests",
]
minversion = "9.0"
python_classes = ["Test*"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
testpaths = ["tests"]
[tool.ty.environment]
python-version = "3.12"
root = ["./src", "./tests", "./scripts", "./mise-tasks", "./packages"]
python = "./.venv"
extra-paths = ["./typings"]
[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 = "warn" # 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.overrides]]
include = ["tests/*.py"]
[tool.ty.overrides.rules]
unresolved-attribute = "ignore" # intentional test mocks and fixtures with dynamic attributes
call-non-callable = "ignore" # intentional test mocks that may not be statically callable
not-iterable = "ignore" # Dynamic import tuples that ty can't infer as iterable
[tool.uv-dynamic-versioning]
fallback-version = "0.0.0"