Skip to content

Commit 447995d

Browse files
authored
Merge pull request #20 from stainless-sdks/mh/remove-deprecated-aliases
chore: remove undocumented backwards-compat alias shims
2 parents 3d68b23 + e5a2ad8 commit 447995d

23 files changed

Lines changed: 16 additions & 223 deletions

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@ reportOverlappingOverload = false
158158

159159
reportImportCycles = false
160160
reportPrivateUsage = false
161-
# Deprecation is a runtime concern; type-check warnings produce noise when the
162-
# breaking-change detector compares against pre-deprecation baseline tests.
163-
# Newly-generated tests already add a per-file `# pyright: reportDeprecated=false`
164-
# marker for deprecated resources, so this just promotes that to project-level.
165-
reportDeprecated = false
166161

167162
[tool.mypy]
168163
pretty = true

scripts/detect-breaking-changes.py

Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,67 +10,11 @@
1010
from rich.style import Style
1111

1212

13-
def _resolve_redirect(obj: griffe.Object | griffe.Alias) -> griffe.Object | griffe.Alias | None:
14-
"""Follow back-compat redirections to a real class definition.
15-
16-
We use two patterns to preserve import paths after a schema rename:
17-
* `from .new_path import NewClass` → `griffe.Alias`
18-
* `OldName = NewClass` (module-level assignment) → `griffe.Attribute`
19-
Both are runtime-equivalent re-exports and should expose the target
20-
class's attributes for breaking-change detection. Without resolving them,
21-
griffe reports every old attribute as removed.
22-
"""
23-
visited: set[int] = set()
24-
current: griffe.Object | griffe.Alias = obj
25-
while id(current) not in visited:
26-
visited.add(id(current))
27-
if isinstance(current, griffe.Alias):
28-
try:
29-
return current.final_target
30-
except Exception:
31-
return None
32-
if isinstance(current, griffe.Attribute):
33-
value = current.value
34-
parent = current.parent
35-
if parent is None or value is None:
36-
return None
37-
if isinstance(value, griffe.ExprName):
38-
next_obj = parent.members.get(str(value))
39-
if next_obj is None:
40-
return None
41-
current = next_obj
42-
continue
43-
if isinstance(value, griffe.ExprAttribute):
44-
# Qualified path like `task_group_status.TaskGroupStatus`.
45-
# Walk segment by segment, resolving any module aliases as we go.
46-
next_obj = parent
47-
for segment in value.values:
48-
if not isinstance(segment, griffe.ExprName):
49-
continue
50-
if isinstance(next_obj, griffe.Alias):
51-
try:
52-
next_obj = next_obj.final_target
53-
except Exception:
54-
return None
55-
if next_obj is None or not hasattr(next_obj, "members"):
56-
return None
57-
next_obj = next_obj.members.get(str(segment))
58-
if next_obj is None:
59-
return None
60-
current = next_obj
61-
continue
62-
return None
63-
return current
64-
return None
65-
66-
6713
def public_members(obj: griffe.Object | griffe.Alias) -> dict[str, griffe.Object | griffe.Alias]:
68-
target = _resolve_redirect(obj)
69-
if target is not None and target is not obj:
70-
obj = target
71-
7214
if isinstance(obj, griffe.Alias):
73-
# Truly opaque alias we couldn't resolve.
15+
# ignore imports for now, they're technically part of the public API
16+
# but we don't have good preventative measures in place to prevent
17+
# changing them
7418
return {}
7519

7620
return {name: value for name, value in obj.all_members.items() if not name.startswith("_")}

src/parallel/types/advanced_extract_settings_param.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,3 @@ class AdvancedExtractSettingsParam(TypedDict, total=False):
3333
Set to true to enable with defaults, false to disable, or provide
3434
FullContentSettings for fine-grained control.
3535
"""
36-
37-
38-
# Backwards-compat alias (deprecated). `FullContentFullContentSettings` was the
39-
# auto-generated nested-class name in this module; it now lives as the top-level
40-
# `FullContentSettingsParam`.
41-
FullContentFullContentSettings = FullContentSettingsParam

src/parallel/types/beta/findall_candidate_match_status_event.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from ..._models import BaseModel
77
from .findall_candidate import FindAllCandidate
88

9-
__all__ = [ "FindallCandidateMatchStatusEvent", "FindAllCandidateMatchStatusEvent"]
9+
__all__ = ["FindAllCandidateMatchStatusEvent"]
1010

1111

1212
class FindAllCandidateMatchStatusEvent(BaseModel):
@@ -33,11 +33,3 @@ class FindAllCandidateMatchStatusEvent(BaseModel):
3333
findall.candidate.unmatched, findall.candidate.discarded,
3434
findall.candidate.enriched.
3535
"""
36-
37-
38-
FindallCandidateMatchStatusEvent = FindAllCandidateMatchStatusEvent # for backwards compatibility with v0.3.4
39-
"""This is deprecated, `FindAllCandidateMatchStatusEvent` should be used instead"""
40-
41-
# Backwards-compat alias (deprecated). `Data` was an inline class in earlier
42-
# releases; it is now the top-level `FindAllCandidate` model.
43-
Data = FindAllCandidate

src/parallel/types/beta/findall_create_params.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .parallel_beta_param import ParallelBetaParam
1111
from .match_condition_param import MatchConditionParam
1212

13-
__all__ = ["FindAllCreateParams", "FindallCreateParams", "ExcludeList"]
13+
__all__ = ["FindAllCreateParams", "ExcludeList"]
1414

1515

1616
class FindAllCreateParams(TypedDict, total=False):
@@ -53,11 +53,3 @@ class ExcludeList(TypedDict, total=False):
5353

5454
url: Required[str]
5555
"""URL of the entity to exclude from results."""
56-
57-
58-
FindallCreateParams = FindAllCreateParams # for backwards compatibility with v0.3.4
59-
"""This is deprecated, `FindAllCreateParams` should be used instead"""
60-
61-
# Backwards-compat alias (deprecated). `MatchCondition` was an inline TypedDict
62-
# in this module; it now lives as the top-level `MatchConditionParam`.
63-
MatchCondition = MatchConditionParam

src/parallel/types/beta/findall_enrich_input.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from ..mcp_server import McpServer
77
from ..json_schema import JsonSchema
88

9-
__all__ = ["FindAllEnrichInput", "FindallEnrichInput"]
9+
__all__ = ["FindAllEnrichInput"]
1010

1111

1212
class FindAllEnrichInput(BaseModel):
@@ -20,7 +20,3 @@ class FindAllEnrichInput(BaseModel):
2020

2121
processor: Optional[str] = None
2222
"""Processor to use for the task."""
23-
24-
25-
FindallEnrichInput = FindAllEnrichInput # for backwards compatibility with v0.3.4
26-
"""This is deprecated, `FindAllEnrichInput` should be used instead"""

src/parallel/types/beta/findall_enrich_params.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ..json_schema_param import JsonSchemaParam
1111
from .parallel_beta_param import ParallelBetaParam
1212

13-
__all__ = ["FindAllEnrichParams", "FindallEnrichParams"]
13+
__all__ = ["FindAllEnrichParams"]
1414

1515

1616
class FindAllEnrichParams(TypedDict, total=False):
@@ -25,7 +25,3 @@ class FindAllEnrichParams(TypedDict, total=False):
2525

2626
betas: Annotated[List[ParallelBetaParam], PropertyInfo(alias="parallel-beta")]
2727
"""Optional header to specify the beta version(s) to enable."""
28-
29-
30-
FindallEnrichParams = FindAllEnrichParams # for backwards compatibility with v0.3.4
31-
"""This is deprecated, `FindAllEnrichParams` should be used instead"""

src/parallel/types/beta/findall_events_params.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from ..._utils import PropertyInfo
99
from .parallel_beta_param import ParallelBetaParam
1010

11-
__all__ = ["FindAllEventsParams", "FindallEventsParams"]
11+
__all__ = ["FindAllEventsParams"]
1212

1313

1414
class FindAllEventsParams(TypedDict, total=False):
@@ -18,7 +18,3 @@ class FindAllEventsParams(TypedDict, total=False):
1818

1919
betas: Annotated[List[ParallelBetaParam], PropertyInfo(alias="parallel-beta")]
2020
"""Optional header to specify the beta version(s) to enable."""
21-
22-
23-
FindallEventsParams = FindAllEventsParams # for backwards compatibility with v0.3.4
24-
"""This is deprecated, `FindAllEventsParams` should be used instead"""

src/parallel/types/beta/findall_events_response.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
from .findall_schema_updated_event import FindAllSchemaUpdatedEvent
1010
from .findall_candidate_match_status_event import FindAllCandidateMatchStatusEvent
1111

12-
__all__ = ["FindAllEventsResponse", "FindallEventsResponse"]
12+
__all__ = ["FindAllEventsResponse"]
1313

1414
FindAllEventsResponse: TypeAlias = Annotated[
1515
Union[FindAllSchemaUpdatedEvent, FindAllRunStatusEvent, FindAllCandidateMatchStatusEvent, ErrorEvent],
1616
PropertyInfo(discriminator="type"),
1717
]
18-
19-
FindallEventsResponse = FindAllEventsResponse # for backwards compatibility with v0.3.4
20-
"""This is deprecated, `FindAllEventsResponse` should be used instead"""

src/parallel/types/beta/findall_extend_params.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from ..._utils import PropertyInfo
99
from .parallel_beta_param import ParallelBetaParam
1010

11-
__all__ = ["FindAllExtendParams", "FindallExtendParams"]
11+
__all__ = ["FindAllExtendParams"]
1212

1313

1414
class FindAllExtendParams(TypedDict, total=False):
@@ -21,7 +21,3 @@ class FindAllExtendParams(TypedDict, total=False):
2121

2222
betas: Annotated[List[ParallelBetaParam], PropertyInfo(alias="parallel-beta")]
2323
"""Optional header to specify the beta version(s) to enable."""
24-
25-
26-
FindallExtendParams = FindAllExtendParams # for backwards compatibility with v0.3.4
27-
"""This is deprecated, `FindAllExtendParams` should be used instead"""

0 commit comments

Comments
 (0)