-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add support for Poetry 1.5 lockfiles #7834
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8e82428
Extract helper to run poetry command
deivid-rodriguez a75e001
Return stdout when poetry command succeeds, raise error when it fails
deivid-rodriguez 37c5a94
Use a better strategy to parse Poetry dependency types
deivid-rodriguez 77fe93b
Fix minor typos
jeffwidman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
34 changes: 0 additions & 34 deletions
34
python/lib/dependabot/python/file_parser/subdependency_type_parser.rb
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require "time" | ||
require "open3" | ||
|
||
require "dependabot/errors" | ||
require "dependabot/shared_helpers" | ||
|
||
module Dependabot | ||
module Python | ||
module Helpers | ||
def self.run_poetry_command(command, fingerprint: nil) | ||
start = Time.now | ||
command = SharedHelpers.escape_command(command) | ||
stdout, stderr, process = Open3.capture3(command) | ||
time_taken = Time.now - start | ||
|
||
# Raise an error with the output from the shell session if Poetry | ||
# returns a non-zero status | ||
return stdout if process.success? | ||
|
||
raise SharedHelpers::HelperSubprocessFailed.new( | ||
message: stderr, | ||
error_context: { | ||
command: command, | ||
fingerprint: fingerprint, | ||
time_taken: time_taken, | ||
process_exit_value: process.to_s | ||
} | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains 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
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.
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.
👍 for using the poetry CLI rather than inspecting the file directly.
However, the docs for
show
indicate that--only main
and--without dev
are both workable here...At first I was thinking that
--without dev
might be better here, asmain
is the default group so there may be other groups, until I saw this note here:So I'm guessing docs/tests, etc are other groups that won't be considered part of
main
, but aren't part ofdev
either...The concept of dep categories isn't quite so sophisticated, we tend to simply have "prod" vs "dev", and in this method solely want prod deps, not "non-dev deps", so
--only main
makes sense to me!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.
Yeah, in general I tend to consider "dev", everything that's not production/runtime, that's why I went with
--only main
.