-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(python): add support for poetry dev dependencies #8152
Merged
+248
−22
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4ab4d2b
feat(python): add support for poetry dev dependencies
nikpivkin 6186b7d
docs: add note about --include-dev-deps
nikpivkin a055b20
Merge remote-tracking branch 'origin' into poetry-dev-deps-2
nikpivkin 71743c1
refactor: rename functions
nikpivkin 05bb7bd
docs: link table and poetry section
nikpivkin b5bafda
fix python docs
nikpivkin 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
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 |
---|---|---|
|
@@ -187,17 +187,31 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { | |
// export PATH="/root/.local/bin:$PATH" | ||
// poetry new groups && cd groups | ||
// poetry add [email protected] | ||
// poetry add [email protected] --extras socks | ||
// poetry add --optional [email protected] | ||
// poetry add --group dev [email protected] | ||
// poetry add --group lint [email protected] | ||
// poetry add --optional [email protected] | ||
name: "skip deps from groups", | ||
name: "with groups", | ||
dir: "testdata/with-groups", | ||
want: &analyzer.AnalysisResult{ | ||
Applications: []types.Application{ | ||
{ | ||
Type: types.Poetry, | ||
FilePath: "poetry.lock", | ||
Packages: types.Packages{ | ||
{ | ||
ID: "[email protected]", | ||
Name: "anyio", | ||
Version: "4.7.0", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
DependsOn: []string{ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "certifi", | ||
|
@@ -212,20 +226,105 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { | |
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "colorama", | ||
Version: "0.4.6", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
Dev: true, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "exceptiongroup", | ||
Version: "1.2.2", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "h11", | ||
Version: "0.14.0", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "httpcore", | ||
Version: "1.0.7", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
DependsOn: []string{ | ||
"[email protected]", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "httpx", | ||
Version: "0.28.1", | ||
Relationship: types.RelationshipDirect, | ||
DependsOn: []string{ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "idna", | ||
Version: "3.10", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "iniconfig", | ||
Version: "2.0.0", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
Dev: true, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "mypy-extensions", | ||
Version: "1.0.0", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "packaging", | ||
Version: "24.2", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
Dev: true, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "pluggy", | ||
Version: "1.5.0", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
Dev: true, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "pytest", | ||
Version: "8.3.4", | ||
Relationship: types.RelationshipDirect, | ||
Dev: true, | ||
DependsOn: []string{ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "requests", | ||
|
@@ -242,8 +341,30 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { | |
ID: "[email protected]", | ||
Name: "ruff", | ||
Version: "0.8.3", | ||
Relationship: types.RelationshipDirect, | ||
Dev: true, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "sniffio", | ||
Version: "1.3.1", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "socksio", | ||
Version: "1.0.0", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
Name: "tomli", | ||
Version: "2.2.1", | ||
Indirect: true, | ||
Relationship: types.RelationshipIndirect, | ||
Dev: true, | ||
}, | ||
{ | ||
ID: "[email protected]", | ||
|
105 changes: 103 additions & 2 deletions
105
pkg/fanal/analyzer/language/python/poetry/testdata/with-groups/poetry.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.
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.
ditto
#8134 (comment)
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.
Fixed b5bafda