Skip to content

Commit 41c3837

Browse files
authored
feat(python): support egg format (fanal#266)
1 parent 34c3c46 commit 41c3837

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

analyzer/language/python/packaging/packaging.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ const version = 1
2121

2222
var (
2323
requiredFiles = []string{
24-
// egg
24+
// .egg format
25+
// https://setuptools.readthedocs.io/en/latest/deprecated/python_eggs.html#eggs-and-their-formats
26+
"EGG-INFO/PKG-INFO",
27+
28+
// .egg-info format: .egg-info can be a file or directory
29+
// https://setuptools.readthedocs.io/en/latest/deprecated/python_eggs.html#eggs-and-their-formats
2530
".egg-info",
2631
".egg-info/PKG-INFO",
2732

analyzer/language/python/packaging/packaging_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ func Test_packagingAnalyzer_Required(t *testing.T) {
113113
filePath string
114114
want bool
115115
}{
116+
{
117+
name: "egg",
118+
filePath: "python2.7/site-packages/cssutils-1.0-py2.7.egg/EGG-INFO/PKG-INFO",
119+
want: true,
120+
},
116121
{
117122
name: "egg-info",
118123
filePath: "python3.8/site-packages/wrapt-1.12.1.egg-info",

0 commit comments

Comments
 (0)