From aa35321ec79d1a1f00ae202c11a79cdbf4ae633c Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 30 Aug 2024 10:37:50 -0500 Subject: [PATCH 1/6] fix: exclude pdm-backend from pip build backend lint --- conda_smithy/linter/hints.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conda_smithy/linter/hints.py b/conda_smithy/linter/hints.py index 43f46ead1..4a0ba7e41 100644 --- a/conda_smithy/linter/hints.py +++ b/conda_smithy/linter/hints.py @@ -181,6 +181,9 @@ def hint_check_spdx(about_section, hints): def hint_pip_no_build_backend(host_or_build_section, package_name, hints): + if package_name in ["pdm-backend"]: + return + if host_or_build_section and any( req.split(" ")[0] == "pip" for req in host_or_build_section ): From 6522b2ea41fc23965d04640d7f682b53f9ce336a Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 30 Aug 2024 10:39:50 -0500 Subject: [PATCH 2/6] Create 2046-pip-hint-exclude.rst --- news/2046-pip-hint-exclude.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/2046-pip-hint-exclude.rst diff --git a/news/2046-pip-hint-exclude.rst b/news/2046-pip-hint-exclude.rst new file mode 100644 index 000000000..44d96e900 --- /dev/null +++ b/news/2046-pip-hint-exclude.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fixed error where ``pdm-backend`` was flagged as not having a backend. (#2046) + +**Security:** + +* From d42577c11efd5bed24953fc38585afa3adb8b4aa Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 30 Aug 2024 10:47:26 -0500 Subject: [PATCH 3/6] Update conda_smithy/linter/hints.py --- conda_smithy/linter/hints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_smithy/linter/hints.py b/conda_smithy/linter/hints.py index 4a0ba7e41..98ad0f8da 100644 --- a/conda_smithy/linter/hints.py +++ b/conda_smithy/linter/hints.py @@ -181,7 +181,7 @@ def hint_check_spdx(about_section, hints): def hint_pip_no_build_backend(host_or_build_section, package_name, hints): - if package_name in ["pdm-backend"]: + if package_name in ["pdm-backend", "setuptools"]: return if host_or_build_section and any( From 9da953584ddf767d9dd1286ff868a3e122ab65c4 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 30 Aug 2024 10:48:40 -0500 Subject: [PATCH 4/6] Update conda_smithy/linter/hints.py --- conda_smithy/linter/hints.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conda_smithy/linter/hints.py b/conda_smithy/linter/hints.py index 98ad0f8da..d79ba0cb9 100644 --- a/conda_smithy/linter/hints.py +++ b/conda_smithy/linter/hints.py @@ -181,6 +181,10 @@ def hint_check_spdx(about_section, hints): def hint_pip_no_build_backend(host_or_build_section, package_name, hints): + # we do NOT exclude all build backends since some of them + # need another backend to bootstrap + # the list below are the ones that self-bootstrap without + # another build backend if package_name in ["pdm-backend", "setuptools"]: return From e0d738ebc3840751c45d122cf76926c2b9ec887c Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 30 Aug 2024 10:49:16 -0500 Subject: [PATCH 5/6] Update 2046-pip-hint-exclude.rst --- news/2046-pip-hint-exclude.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/2046-pip-hint-exclude.rst b/news/2046-pip-hint-exclude.rst index 44d96e900..be47a422f 100644 --- a/news/2046-pip-hint-exclude.rst +++ b/news/2046-pip-hint-exclude.rst @@ -16,7 +16,7 @@ **Fixed:** -* Fixed error where ``pdm-backend`` was flagged as not having a backend. (#2046) +* Fixed error where some python build backends were flagged as not having a backend. (#2046) **Security:** From 14bc2dbed6c64328341ec8b2048e70636433fea5 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 1 Sep 2024 12:55:59 +1100 Subject: [PATCH 6/6] ensure we refresh the linter hints regularly --- conda_smithy/linter/utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/conda_smithy/linter/utils.py b/conda_smithy/linter/utils.py index 31c8545bf..3f4e203b8 100644 --- a/conda_smithy/linter/utils.py +++ b/conda_smithy/linter/utils.py @@ -2,6 +2,7 @@ import os import re import sys +import time from collections.abc import Sequence from functools import lru_cache from glob import glob @@ -208,8 +209,15 @@ def _lint_package_version(version: Optional[str]) -> Optional[str]: return invalid_version.format(ver=ver, err=e) -@lru_cache(maxsize=1) def load_linter_toml_metdata(): + # ensure we refresh the cache every hour + ttl = 3600 + time_salt = int(time.time() / ttl) + return load_linter_toml_metdata_internal(time_salt) + + +@lru_cache(maxsize=1) +def load_linter_toml_metdata_internal(time_salt): hints_toml_url = "https://raw.githubusercontent.com/conda-forge/conda-forge-pinning-feedstock/main/recipe/linter_hints/hints.toml" hints_toml_req = requests.get(hints_toml_url) if hints_toml_req.status_code != 200: