Skip to content

Commit 5fb2921

Browse files
Merge pull request #9 from Azureblade3808/v0.2.0
V0.2.0
2 parents 7f04140 + be78026 commit 5fb2921

File tree

7 files changed

+693
-422
lines changed

7 files changed

+693
-422
lines changed

pyproject.toml

Lines changed: 120 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "runtime-keypath"
7-
version = "0.1.7"
87
authors = [{ name = "Chris Fu", email = "[email protected]" }]
98
description = "Supports runtime key-path recording/accessing for Python."
109
classifiers = [
@@ -17,8 +16,127 @@ classifiers = [
1716
readme = "README.md"
1817
license = { file = "LICENSE" }
1918
requires-python = ">=3.8"
20-
dependencies = ["typing_extensions >= 4.9"]
19+
dynamic = ["version"]
2120

2221
[project.urls]
2322
Homepage = "https://github.com/Azureblade3808/py-runtime-keypath"
2423
"Bug Tracker" = "https://github.com/Azureblade3808/py-runtime-keypath/issues"
24+
25+
[tool.isort]
26+
profile = "black"
27+
28+
case_sensitive = true
29+
combine_as_imports = true
30+
reverse_relative = true
31+
star_first = true
32+
treat_all_comments_as_code = true
33+
34+
[tool.pyright]
35+
36+
# region[Main Configuration Options]
37+
include = ["**/*.py", "**/*.pyi"]
38+
39+
pythonPlatform = "All"
40+
41+
typeCheckingMode = "strict"
42+
useLibraryCodeForTypes = false
43+
# endregion
44+
45+
# region[Type Check Diagnostics Settings]
46+
analyzeUnannotatedFunctions = true
47+
strictParameterNoneValue = false
48+
enableTypeIgnoreComments = true
49+
disableBytesTypePromotions = true
50+
strictListInference = false
51+
strictDictionaryInference = false
52+
strictSetInference = false
53+
deprecateTypingAliases = true
54+
enableExperimentalFeatures = false
55+
reportMissingTypeStubs = "none"
56+
reportMissingModuleSource = "error"
57+
reportInvalidTypeForm = "error"
58+
reportMissingImports = "error"
59+
reportUndefinedVariable = "error"
60+
reportAssertAlwaysTrue = "error"
61+
reportInvalidStringEscapeSequence = "error"
62+
reportInvalidTypeVarUse = "error"
63+
reportSelfClsParameterName = "warning"
64+
reportUnsupportedDunderAll = "warning"
65+
reportUnusedExpression = "none"
66+
reportWildcardImportFromLibrary = "warning"
67+
reportAbstractUsage = "error"
68+
reportArgumentType = "error"
69+
reportAssertTypeFailure = "error"
70+
reportAssignmentType = "error"
71+
reportAttributeAccessIssue = "error"
72+
reportCallIssue = "error"
73+
reportGeneralTypeIssues = "error"
74+
reportInconsistentOverload = "error"
75+
reportIndexIssue = "error"
76+
reportInvalidTypeArguments = "error"
77+
reportNoOverloadImplementation = "error"
78+
reportOperatorIssue = "error"
79+
reportOptionalSubscript = "error"
80+
reportOptionalMemberAccess = "error"
81+
reportOptionalCall = "error"
82+
reportOptionalIterable = "error"
83+
reportOptionalContextManager = "error"
84+
reportOptionalOperand = "error"
85+
reportRedeclaration = "error"
86+
reportReturnType = "error"
87+
reportTypedDictNotRequiredAccess = "error"
88+
reportPrivateImportUsage = "error"
89+
reportUnboundVariable = "error"
90+
reportUnhashable = "error"
91+
reportUnusedCoroutine = "error"
92+
reportUnusedExcept = "error"
93+
reportFunctionMemberAccess = "warning"
94+
reportIncompatibleMethodOverride = "error"
95+
reportIncompatibleVariableOverride = "error"
96+
reportOverlappingOverload = "none"
97+
reportPossiblyUnboundVariable = "error"
98+
reportConstantRedefinition = "error"
99+
reportDeprecated = "warning"
100+
reportDuplicateImport = "error"
101+
reportIncompleteStub = "warning"
102+
reportInconsistentConstructor = "error"
103+
reportInvalidStubStatement = "error"
104+
reportMatchNotExhaustive = "error"
105+
reportMissingParameterType = "none"
106+
reportMissingTypeArgument = "none"
107+
reportPrivateUsage = "none"
108+
reportTypeCommentUsage = "error"
109+
reportUnknownArgumentType = "none"
110+
reportUnknownLambdaType = "none"
111+
reportUnknownMemberType = "none"
112+
reportUnknownParameterType = "none"
113+
reportUnknownVariableType = "none"
114+
reportUnnecessaryCast = "none"
115+
reportUnnecessaryComparison = "none"
116+
reportUnnecessaryContains = "none"
117+
reportUnnecessaryIsInstance = "none"
118+
reportUnusedClass = "warning"
119+
reportUnusedImport = "warning"
120+
reportUnusedFunction = "warning"
121+
reportUnusedVariable = "warning"
122+
reportUntypedBaseClass = "warning"
123+
reportUntypedClassDecorator = "none"
124+
reportUntypedFunctionDecorator = "none"
125+
reportUntypedNamedTuple = "warning"
126+
reportCallInDefaultInitializer = "warning"
127+
reportImplicitOverride = "none"
128+
reportImplicitStringConcatenation = "warning"
129+
reportImportCycles = "none"
130+
reportMissingSuperCall = "none"
131+
reportPropertyTypeMismatch = "none"
132+
reportShadowedImports = "warning"
133+
reportUninitializedInstanceVariable = "none"
134+
reportUnnecessaryTypeIgnoreComment = "none"
135+
reportUnusedCallResult = "error"
136+
# endregion
137+
138+
[tool.pytest.ini_options]
139+
python_files = ["**/__test__.py", "**/*_test.py"]
140+
141+
[tool.setuptools.dynamic]
142+
version = { attr = "runtime_keypath.__version__" }

runtime_keypath/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
from ._core import *
1+
__version__ = "0.2.0"
2+
3+
######
4+
5+
from ._core import *
6+
from ._sugarful import *
7+
from ._sugarless import *
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88

9-
from ._core import *
9+
from . import *
1010

1111

1212
class Tests__KeyPathSupporting:

runtime_keypath/__typecheck__.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""
2+
Makes sure that type-checking works as expected.
3+
"""
4+
5+
# pyright: reportUnnecessaryTypeIgnoreComment = true
6+
7+
######
8+
9+
from __future__ import annotations
10+
11+
__all__ = []
12+
13+
######
14+
15+
from typing import Any
16+
17+
from typing_extensions import assert_type
18+
19+
from . import *
20+
21+
######
22+
23+
24+
class Check__KeyPath:
25+
@staticmethod
26+
def check__sugarful(any_: Any, /) -> None:
27+
class A:
28+
b: B
29+
30+
class B:
31+
c: C
32+
33+
class C:
34+
pass
35+
36+
a: A = any_
37+
__ = assert_type(KeyPath[C] or a.b.c, "KeyPath[C]")
38+
39+
@staticmethod
40+
def check__sugarless(any_: Any, /) -> None:
41+
class A:
42+
b: B
43+
44+
class B:
45+
c: C
46+
47+
class C:
48+
pass
49+
50+
a: A = any_
51+
__ = assert_type(KeyPath.of(a.b.c), "KeyPath[C]")

0 commit comments

Comments
 (0)