(fragment: str)
| 12 | |
| 13 | |
| 14 | def pypi_api_fetch(fragment: str) -> dict: |
| 15 | fragment = fragment.lstrip('/') |
| 16 | url = f'{PYPI_API_BASE}/{fragment}' |
| 17 | try: |
| 18 | with urllib.request.urlopen(url, timeout=5) as response: |
| 19 | return json.loads(response.read().decode('utf8')) |
| 20 | except urllib.error.URLError: |
| 21 | print(f'Failed to connect to PyPi on {url}', file=sys.stderr) |
| 22 | return {} |
| 23 | |
| 24 | |
| 25 | def _dependencies_checkup() -> None: |
no test coverage detected