From 725d5d155d8d04eb14032de847ec5d95a7e826db Mon Sep 17 00:00:00 2001 From: James Myatt Date: Mon, 17 Feb 2025 09:55:30 +0000 Subject: [PATCH 1/2] Treat SSL errors as not available --- grayskull/base/pkg_info.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/grayskull/base/pkg_info.py b/grayskull/base/pkg_info.py index 4e742a5a0..4cbd253db 100644 --- a/grayskull/base/pkg_info.py +++ b/grayskull/base/pkg_info.py @@ -11,9 +11,12 @@ def is_pkg_available(pkg_name: str, channel: str = "conda-forge") -> bool: :param channel: Anaconda channel :return: Return True if the package is present on the given channel """ - response = requests.get( - url=f"https://anaconda.org/{channel}/{pkg_name}/files", allow_redirects=False - ) + try: + response = requests.get( + url=f"https://anaconda.org/{channel}/{pkg_name}/files", allow_redirects=False + ) + except requests.exceptions.SSLError: + return False return response.status_code == 200 From 4ec4a4cf36e4c01e85d4c7b3ff530be3b8a6d65b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:01:20 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- grayskull/base/pkg_info.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grayskull/base/pkg_info.py b/grayskull/base/pkg_info.py index 4cbd253db..267c4b5b7 100644 --- a/grayskull/base/pkg_info.py +++ b/grayskull/base/pkg_info.py @@ -13,7 +13,8 @@ def is_pkg_available(pkg_name: str, channel: str = "conda-forge") -> bool: """ try: response = requests.get( - url=f"https://anaconda.org/{channel}/{pkg_name}/files", allow_redirects=False + url=f"https://anaconda.org/{channel}/{pkg_name}/files", + allow_redirects=False, ) except requests.exceptions.SSLError: return False