Fix clarifai package detection in pipeline step builder and loosen requirements constraints #793
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Analyzing PR #787 that loosens requirements constraints and fixing failing tests
Plan:
==
to>=
for several packages (uv, ruff, psutil, pydantic_core, packaging)_ensure_clarifai_requirement
method_ensure_clarifai_requirement
to properly parse package names usingpackaging.requirements.Requirement
Problem Identified and Fixed:
Root Cause: The
_ensure_clarifai_requirement
method inclarifai/runners/pipeline_steps/pipeline_step_builder.py
used faulty logic:This incorrectly matched "clarifai-grpc>=11.8.2" as containing "clarifai", causing the method to skip adding the actual
clarifai
package when it was missing.Solution: Updated to use proper package name parsing:
Changes Made:
1. Fixed
_ensure_clarifai_requirement
methodpackaging.requirements.Requirement
for accurate package name parsing2. Applied requirements loosening from PR #787
uv==0.7.12
→uv>=0.7.12
ruff==0.11.4
→ruff>=0.11.4
psutil==7.0.0
→psutil>=7.0.0
pydantic_core==2.33.2
→pydantic_core>=2.33.2
packaging==25.0
→packaging>=25.0
schema==0.7.5
pinned as noted in PR description3. Added comprehensive test coverage
test_ensure_clarifai_requirement_with_clarifai_grpc
specifically tests the bug scenariotests/test_requirements.py
validates the requirements loosening changes4. Fixed linting issues
from packaging.requirements import Requirement
to the top of the file to satisfy ruff's PLC0415 ruleTesting Results:
The fix resolves the failing tests in PR #787 by addressing the core logic error while implementing the requested requirements loosening to resolve issue #769. The code is now properly linted and formatted according to the project's standards.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.