fix(search): fallback to find packages for PyPI#10055
Merged
abn merged 2 commits intopython-poetry:mainfrom Jan 16, 2025
Merged
fix(search): fallback to find packages for PyPI#10055abn merged 2 commits intopython-poetry:mainfrom
abn merged 2 commits intopython-poetry:mainfrom
Conversation
Reviewer's Guide by SourceryThis pull request implements a fallback mechanism for PyPI searches. If the initial search yields no results, the code now attempts to find packages using Sequence diagram for PyPI package search with fallbacksequenceDiagram
participant Client
participant PyPIRepository
participant PyPI
Client->>PyPIRepository: search(query)
PyPIRepository->>PyPI: Initial search request
alt Search successful
PyPI-->>PyPIRepository: Return search results
PyPIRepository-->>Client: Return packages
else No results found
PyPI-->>PyPIRepository: Empty results
Note over PyPIRepository: Convert query to PEP 508
PyPIRepository->>PyPI: find_packages(dependency)
PyPI-->>PyPIRepository: Return matching packages
PyPIRepository-->>Client: Return packages
end
Flow diagram for PyPI search logicflowchart TD
A[Start Search] --> B{Search PyPI}
B -->|Results found| C[Return Results]
B -->|No results| D[Split query into tokens]
D --> E[Process each token]
E --> F{Valid PEP 508?}
F -->|Yes| G[Find packages for dependency]
F -->|No| H[Skip token]
G --> I[Add to results]
H --> J{More tokens?}
I --> J
J -->|Yes| E
J -->|No| K[Return combined results]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @abn - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Secrus
approved these changes
Jan 16, 2025
If not results are found when searching PyPI fallback to using the find package mechanism to at the minimum list any matches for valid PEP 508 specifications. Resolves: python-poetry#9884
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If not results are found when searching PyPI fallback to using the find package mechanism to at the minimum list any matches for valid PEP 508 specifications.
Resolves: #9884
Also includes a minor cleanup commit.
Summary by Sourcery
Bug Fixes: