From ef977fbb0e2270ce484851bef5b4463c90453b46 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 21:09:14 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.12.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87373f4..1338d74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - tomli - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.13 + rev: v0.12.0 hooks: # Run the linter. - id: ruff-check From 58c3beb1df5b6a644f77d8a3e475c731d6aed0fe Mon Sep 17 00:00:00 2001 From: Kaleb Barrett Date: Mon, 23 Jun 2025 16:21:09 -0600 Subject: [PATCH 2/2] Fix ruff issues --- src/find_libpython/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/find_libpython/__init__.py b/src/find_libpython/__init__.py index 923e525..62663d8 100644 --- a/src/find_libpython/__init__.py +++ b/src/find_libpython/__init__.py @@ -26,16 +26,18 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +import argparse import ctypes +import logging import os import sys from ctypes.util import find_library as _find_library -from logging import getLogger as _getLogger +from functools import wraps from sysconfig import get_config_var as _get_config_var from find_libpython._version import __version__ # noqa: F401 -_logger = _getLogger("find_libpython") +_logger = logging.getLogger("find_libpython") _is_apple = sys.platform == "darwin" _is_cygwin = sys.platform in ("msys", "cygwin") @@ -122,7 +124,6 @@ def _uniquifying(items): def _uniquified(func): """Wrap iterator returned from `func` by `_uniquifying`.""" - from functools import wraps @wraps(func) def wrapper(*args, **kwds): @@ -392,8 +393,6 @@ def _print_all(items): def _cli_find_libpython(cli_op, verbose): - import logging - # Importing `logging` module here so that using `logging.debug` # instead of `_logger.debug` outside of this function becomes an # error. @@ -425,8 +424,6 @@ def _log_platform_info(): def main(args=None): - import argparse - parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "-v", "--verbose", action="store_true", help="Print debugging information."