@@ -184,13 +184,6 @@ class PackageScanner(ScanPlugin):
184
184
help = 'Show the list of supported package manifest parsers and exit.' ,
185
185
help_group = DOC_GROUP ,
186
186
),
187
- PluggableCommandLineOption (
188
- ('--package-summary' ,),
189
- is_flag = True ,
190
- default = False ,
191
- help = 'Generate Package Level summary' ,
192
- help_group = POST_SCAN_GROUP ,
193
- ),
194
187
]
195
188
196
189
def is_enabled (self , package , system_package , package_only , ** kwargs ):
@@ -209,7 +202,7 @@ def get_scanner(self, package=True, system_package=False, package_only=False, **
209
202
package_only = package_only ,
210
203
)
211
204
212
- def process_codebase (self , codebase , strip_root = False , package_only = False , ** kwargs ):
205
+ def process_codebase (self , codebase , strip_root = False , package_only = False , package_summary = False , ** kwargs ):
213
206
"""
214
207
Populate the ``codebase`` top level ``packages`` and ``dependencies``
215
208
with package and dependency instances, assembling parsed package data
@@ -269,7 +262,7 @@ def process_codebase(self, codebase, strip_root=False, package_only=False, **kwa
269
262
logger_debug (f'packagedcode: process_codebase: add_license_from_sibling_file: modified: { modified } ' )
270
263
271
264
# Create codebase-level packages and dependencies
272
- create_package_and_deps (codebase , strip_root = strip_root , ** kwargs )
265
+ create_package_and_deps (codebase , package_summary , strip_root = strip_root , ** kwargs )
273
266
#raise Exception()
274
267
275
268
if has_licenses :
@@ -288,7 +281,7 @@ class PackageSummary(PostScanPlugin):
288
281
"""
289
282
run_order = 8
290
283
sort_order = 8
291
-
284
+
292
285
options = [
293
286
PluggableCommandLineOption (('--package-summary' ,),
294
287
is_flag = True , default = False ,
@@ -305,6 +298,7 @@ def process_codebase(self, codebase, package_summary, **kwargs):
305
298
"""
306
299
if not self .is_enabled (package_summary ):
307
300
return
301
+
308
302
309
303
def add_license_from_file (resource , codebase ):
310
304
"""
@@ -385,7 +379,7 @@ def get_installed_packages(root_dir, processes=2, **kwargs):
385
379
yield from packages_by_uid .values ()
386
380
387
381
388
- def create_package_and_deps (codebase , package_adder = add_to_package , strip_root = False , ** kwargs ):
382
+ def create_package_and_deps (codebase , package_summary , package_adder = add_to_package , strip_root = False , ** kwargs ):
389
383
"""
390
384
Create and save top-level Package and Dependency from the parsed
391
385
package data present in the codebase.
@@ -397,7 +391,7 @@ def create_package_and_deps(codebase, package_adder=add_to_package, strip_root=F
397
391
** kwargs
398
392
)
399
393
400
- codebase .attributes .packages .extend (package .to_dict () for package in packages )
394
+ codebase .attributes .packages .extend (package .to_dict (package_summary ) for package in packages )
401
395
codebase .attributes .dependencies .extend (dep .to_dict () for dep in dependencies )
402
396
403
397
0 commit comments