-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(search): fallback to find packages for PyPI #10055
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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
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: