Skip to content

Commit fd950e2

Browse files
committed
fix(python): ecosystem="pypi"
1 parent 635b97e commit fd950e2

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

module/python/buildout/buildout.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import (
1919
"github.com/murphysecurity/murphysec/utils"
2020
)
2121

22+
var EcoRepo = model.EcoRepo{
23+
Ecosystem: "pypi",
24+
Repository: "",
25+
}
26+
2227
func doBuildout(ctx context.Context, dir string) (errorText string, e error) {
2328
var cmd = exec.CommandContext(ctx, "buildout")
2429
cmd.Dir = dir
@@ -140,10 +145,7 @@ func InspectProject(ctx context.Context, dir string) error {
140145
Component: model.Component{
141146
CompName: n,
142147
CompVersion: v,
143-
EcoRepo: model.EcoRepo{
144-
Ecosystem: "pypi",
145-
Repository: "",
146-
},
148+
EcoRepo: EcoRepo,
147149
},
148150
IsOnline: model.IsOnlineTrue(),
149151
},

module/python/buildout/parsingFiles.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@ func parseBuildoutBytes(ctx context.Context, by []byte, path string) ([]string,
161161
Component: model.Component{
162162
CompName: key.Name(),
163163
CompVersion: key.Value(),
164-
EcoRepo: model.EcoRepo{
165-
Ecosystem: "pypi",
166-
Repository: "",
167-
},
164+
EcoRepo: EcoRepo,
168165
},
169166
IsOnline: model.IsOnlineTrue(),
170167
})
@@ -217,10 +214,7 @@ func parseBuildoutCfgFile(ctx context.Context, path string) ([]string, error) {
217214
Component: model.Component{
218215
CompName: key.Name(),
219216
CompVersion: key.Value(),
220-
EcoRepo: model.EcoRepo{
221-
Ecosystem: "pypi",
222-
Repository: "",
223-
},
217+
EcoRepo: EcoRepo,
224218
},
225219
IsOnline: model.IsOnlineTrue(),
226220
})

module/python/python.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (i Inspector) InspectProject(ctx context.Context) error {
102102
}
103103

104104
var EcoRepo = model.EcoRepo{
105-
Ecosystem: "pip",
105+
Ecosystem: "pypi",
106106
Repository: "",
107107
}
108108

module/python/venv.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,7 @@ func buildTree(pipdeptree PipdeptreeStruct, level int) model.DependencyItem {
240240
Component: model.Component{
241241
CompName: pipdeptree.Key,
242242
CompVersion: pipdeptree.InstalledVersion,
243-
EcoRepo: model.EcoRepo{
244-
Ecosystem: "pip",
245-
Repository: "",
246-
},
243+
EcoRepo: EcoRepo,
247244
},
248245
IsDirectDependency: directDependency,
249246
}
@@ -270,10 +267,7 @@ func directDependenceSurvival(mod *[]model.DependencyItem, nvMp map[string]strin
270267
Component: model.Component{
271268
CompName: k,
272269
CompVersion: v,
273-
EcoRepo: model.EcoRepo{
274-
Ecosystem: "pip",
275-
Repository: "",
276-
},
270+
EcoRepo: EcoRepo,
277271
},
278272
IsDirectDependency: true,
279273
})

0 commit comments

Comments
 (0)