fix(python): skip dev group's deps for poetry#8106
Conversation
Signed-off-by: nikpivkin <[email protected]>
Signed-off-by: nikpivkin <[email protected]>
Signed-off-by: nikpivkin <[email protected]>
|
[dependency-groups]
test = ["pytest<8", "coverage"]
typing = ["mypy==1.7.1", "types-requests"]
lint = ["black", "flake8"]
dev = [{include-group = "test"}, {include-group = "typing"}, {include-group = "lint"}] |
Signed-off-by: nikpivkin <[email protected]>
81d513f to
7de61c8
Compare
DmitriyLewen
left a comment
There was a problem hiding this comment.
LGTM. Left 2 small comments
Signed-off-by: nikpivkin <[email protected]>
Signed-off-by: nikpivkin <[email protected]>
| func (d *dependencies) UnmarshalTOML(data any) error { | ||
| m, ok := data.(map[string]any) | ||
| if !ok { | ||
| return fmt.Errorf("dependencies must be map, but got: %T", data) |
There was a problem hiding this comment.
nit: for consistency and stacktrace
| return fmt.Errorf("dependencies must be map, but got: %T", data) | |
| return xerrors.Errorf("dependencies must be map, but got: %T", data) |
| } | ||
|
|
||
| func (a poetryAnalyzer) parsePyProject(fsys fs.FS, path string) (map[string]any, error) { | ||
| func filterProdPackages(project pyproject.PyProject, app *types.Application) { |
There was a problem hiding this comment.
We should flag the Dev field instead of filtering for --include-dev-deps, but if you want to keep the original behavior in this PR, we can add the change in a separate PR.
There was a problem hiding this comment.
@knqyf263 as i wrote in #8080 (comment) - are you sure that we want to add dev deps under Dev field?
Previously we only did this upon request from users.
I have yet to meet a python user who needs to scan for dev dependencies
There was a problem hiding this comment.
Hmm. It sounds reasonable, but we should add a new column showing if --include-dev-deps is supported.
There was a problem hiding this comment.
But if the implementation cost is not so different, it's better to mark dev dependencies.
There was a problem hiding this comment.
I'll open another PR for this one
Signed-off-by: nikpivkin <[email protected]>
|
@aqua-bot backport release/v0.58 |
Signed-off-by: nikpivkin <[email protected]>
|
Backport PR created: #8158 |
Description
This PR skips dependencies from the
devgroup for the poetry.Related issues
Checklist