Return a mapping of package manifest information detected in the file at ``location``. Include ``application`` packages (such as pypi) and/or ``system`` packages. Note that all exceptions are caught if there are any errors while parsing a package manifest.
(
location,
application=True,
system=False,
compiled=False,
package_only=False,
**kwargs
)
| 257 | |
| 258 | |
| 259 | def _get_package_data( |
| 260 | location, |
| 261 | application=True, |
| 262 | system=False, |
| 263 | compiled=False, |
| 264 | package_only=False, |
| 265 | **kwargs |
| 266 | ): |
| 267 | """ |
| 268 | Return a mapping of package manifest information detected in the file at ``location``. |
| 269 | Include ``application`` packages (such as pypi) and/or ``system`` packages. |
| 270 | Note that all exceptions are caught if there are any errors while parsing a |
| 271 | package manifest. |
| 272 | """ |
| 273 | assert application or system or compiled or package_only |
| 274 | from packagedcode.recognize import recognize_package_data |
| 275 | try: |
| 276 | return recognize_package_data( |
| 277 | location=location, |
| 278 | application=application, |
| 279 | system=system, |
| 280 | compiled=compiled, |
| 281 | package_only=package_only, |
| 282 | ) or [] |
| 283 | |
| 284 | except Exception as e: |
| 285 | if TRACE: |
| 286 | logger.error(f'_get_package_data: location: {location!r}: Exception: {e}') |
| 287 | |
| 288 | if SCANCODE_DEBUG_PACKAGE_API: |
| 289 | raise |
| 290 | else: |
| 291 | # attention: we are swallowing ALL exceptions here! |
| 292 | pass |
| 293 | |
| 294 | |
| 295 | def get_package_info(location, **kwargs): |
no test coverage detected