From 22553d94ab86993940cea42f0036e7cc35bbedd3 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 15 Jan 2025 11:06:04 -0700 Subject: [PATCH 1/3] Protect imports of subcommand via entry points Previously errors loading a subcommand broke everything (unlike the old way of loading subcommands). --- python/lsst/daf/butler/cli/butler.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python/lsst/daf/butler/cli/butler.py b/python/lsst/daf/butler/cli/butler.py index f6faa1db59..1c1a0ad965 100755 --- a/python/lsst/daf/butler/cli/butler.py +++ b/python/lsst/daf/butler/cli/butler.py @@ -334,7 +334,16 @@ def _getPluginCommands(cls) -> defaultdict[str, list[str | PluginCommand]]: if hasattr(cls, "entryPoint"): plugins = entry_points(group=cls.entryPoint) for p in plugins: - func = p.load() + try: + func = p.load() + except Exception as err: + log.warning("Could not import plugin from entry point %s, skipping.", p) + log.debug( + "Plugin import exception: %s\nTraceback:\n%s", + err, + "".join(traceback.format_tb(err.__traceback__)), + ) + continue func_name = get_full_type_name(func) pluginCommands = {cmd.name: [PluginCommand(cmd, func_name)] for cmd in func()} cls._mergeCommandLists(commands, defaultdict(list, pluginCommands)) From 3bfe4fd3f0d49952996b746008ddadd3534e0d81 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 15 Jan 2025 11:06:50 -0700 Subject: [PATCH 2/3] Refresh pre-commit --- .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 3d8b37e61c..fff0807c5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: name: isort (python) - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.7.4 + rev: v0.9.1 hooks: - id: ruff - repo: https://github.com/numpy/numpydoc From 7ee97ef10cd3b1294870c9083b78431a87a29ee9 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 15 Jan 2025 11:09:43 -0700 Subject: [PATCH 3/3] Stop installing sqlite in github doc action It stopped being available. --- .github/workflows/build_docs.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index 805c738816..4a3c39c2db 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -22,9 +22,6 @@ jobs: cache: "pip" cache-dependency-path: "setup.cfg" - - name: Install sqlite - run: sudo apt-get install sqlite libyaml-dev - - name: Install uv run: | python -m pip install --upgrade pip