Fix release builds#2629
Conversation
Greptile SummaryThis PR fixes the release build pipeline by removing the deprecated
Confidence Score: 4/5The workflow and dependency removals are correct; the replacement annotation-compliance code is well-structured and tested, but the typing_extensions version floor in pyproject.toml is lower than what the new imports actually require. The new annotation checker imports get_protocol_members and is_protocol from typing_extensions, both of which were added in 4.7.0, but the declared dependency floor is >=4.0. On Python 3.10 in a clean environment where pip resolves the oldest satisfying version, this will produce an ImportError at runtime. The change otherwise looks solid — manylinux images are correct for both arches, the KeyError guard on defaulted spec parameters is in place, and the new helper logic is covered by targeted tests. pyproject.toml — the typing_extensions version specifier needs attention to match what the new imports actually require. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["spec_annotation_compliance(obj, proto)"] --> B{"is_spec(proto)?"}
B -->|No| C["raise TypeError"]
B -->|Yes| D{"isinstance(obj, runtime_checkable(proto))?"}
D -->|No| E["return False"]
D -->|Yes| F["For each name in get_protocol_members(proto)"]
F --> G{"spec_sig obtainable?"}
G -->|No| H["skip - data attribute"]
H --> F
G -->|Yes| I{"impl_sig obtainable?"}
I -->|No| E
I -->|Yes| J["_signatures_compatible(spec_sig, impl_sig)"]
J --> K{"return annotations compatible?"}
K -->|No| E
K -->|Yes| L["Build args/kwargs from impl params\nskip extra optional params not in spec"]
L --> M{"spec_sig.bind succeeds?"}
M -->|No| E
M -->|Yes| N["For each spec_param"]
N --> O{"VAR_POSITIONAL or VAR_KEYWORD?"}
O -->|Yes| P["skip"]
P --> T
O -->|No| Q{"param name in bound.arguments?"}
Q -->|No| E
Q -->|Yes| R{"name and kind compatible?"}
R -->|No| E
R -->|Yes| S{"_annotation_compatible?"}
S -->|No| E
S -->|Yes| T{"more params?"}
T -->|Yes| N
T -->|No| U["return True"]
U --> F
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["spec_annotation_compliance(obj, proto)"] --> B{"is_spec(proto)?"}
B -->|No| C["raise TypeError"]
B -->|Yes| D{"isinstance(obj, runtime_checkable(proto))?"}
D -->|No| E["return False"]
D -->|Yes| F["For each name in get_protocol_members(proto)"]
F --> G{"spec_sig obtainable?"}
G -->|No| H["skip - data attribute"]
H --> F
G -->|Yes| I{"impl_sig obtainable?"}
I -->|No| E
I -->|Yes| J["_signatures_compatible(spec_sig, impl_sig)"]
J --> K{"return annotations compatible?"}
K -->|No| E
K -->|Yes| L["Build args/kwargs from impl params\nskip extra optional params not in spec"]
L --> M{"spec_sig.bind succeeds?"}
M -->|No| E
M -->|Yes| N["For each spec_param"]
N --> O{"VAR_POSITIONAL or VAR_KEYWORD?"}
O -->|Yes| P["skip"]
P --> T
O -->|No| Q{"param name in bound.arguments?"}
Q -->|No| E
Q -->|Yes| R{"name and kind compatible?"}
R -->|No| E
R -->|Yes| S{"_annotation_compatible?"}
S -->|No| E
S -->|Yes| T{"more params?"}
T -->|Yes| N
T -->|No| U["return True"]
U --> F
Reviews (3): Last reviewed commit: "Fix" | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #2629 +/- ##
==========================================
- Coverage 71.04% 71.01% -0.04%
==========================================
Files 892 892
Lines 79287 79371 +84
Branches 7079 7100 +21
==========================================
+ Hits 56330 56362 +32
- Misses 21114 21156 +42
- Partials 1843 1853 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Backport branch created but failed to create PR. (see action log for full response) |
Someone more familiar with the reason for using annotation-protocol should probably review and simplify these changes later, I doubt we need this much complexity for the one check (maybe a pydantic check would be enough?).