Return a mapping of package data or None for a Distribution `distribution`.
(distribution)
| 56 | |
| 57 | |
| 58 | def get_package_data(distribution): |
| 59 | """ |
| 60 | Return a mapping of package data or None for a Distribution `distribution`. |
| 61 | """ |
| 62 | results = fetch_dejacode_packages(distribution.identifiers()) |
| 63 | |
| 64 | len_results = len(results) |
| 65 | |
| 66 | if len_results == 1: |
| 67 | return results[0] |
| 68 | |
| 69 | elif len_results > 1: |
| 70 | print(f"More than 1 entry exists, review at: {DEJACODE_API_URL_PACKAGES}") |
| 71 | else: |
| 72 | print("Could not find package:", distribution.download_url) |
| 73 | |
| 74 | |
| 75 | def update_with_dejacode_data(distribution): |
no test coverage detected