feat(source/show): notify when PyPI is implicit#9974
Merged
abn merged 1 commit intopython-poetry:mainfrom Jan 10, 2025
Merged
Conversation
Reviewer's Guide by SourceryThis pull request introduces a notification feature to inform users when PyPI is implicitly enabled as a primary source in the 'source show' command. It adds a new method to handle this notification and updates the command logic to trigger it appropriately. Additionally, a test case is added to ensure the notification works as expected. Sequence diagram for source show command with implicit PyPI notificationsequenceDiagram
actor User
participant CLI as Poetry CLI
participant ShowCmd as SourceShowCommand
participant Pool as Poetry Pool
User->>CLI: poetry source show
CLI->>ShowCmd: handle()
ShowCmd->>ShowCmd: get_sources()
alt no sources configured
ShowCmd->>ShowCmd: notify_implicit_pypi()
ShowCmd->>Pool: has_repository('pypi')
Pool-->>ShowCmd: true/false
ShowCmd-->>User: Display implicit PyPI notice
else sources exist
loop for each source
ShowCmd->>ShowCmd: Display source info
end
alt PyPI not explicitly configured
ShowCmd->>ShowCmd: notify_implicit_pypi()
ShowCmd->>Pool: has_repository('pypi')
Pool-->>ShowCmd: true/false
ShowCmd-->>User: Display implicit PyPI notice
end
end
Class diagram for updated SourceShowCommandclassDiagram
class SourceShowCommand {
+handle(): int
+notify_implicit_pypi(): None
}
note for SourceShowCommand "Added notify_implicit_pypi() method
to handle PyPI implicit source notification"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
86c1938 to
21525c5
Compare
21525c5 to
e89675e
Compare
Secrus
approved these changes
Jan 10, 2025
Add a notice when all sources are listed and PyPI is implicitly enabled.
e89675e to
353dc1f
Compare
|
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.
Add a notice when all sources are listed and PyPI is implicitly enabled.
Summary by Sourcery
Add a notification to inform users when PyPI is implicitly enabled as a primary source and update tests to verify this behavior.
New Features:
Tests: