Universal SEO skill for Claude Code. 26 sub-skills + 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.
test: skip cleanly instead of aborting collection on missing optional deps
Agrici Daniel3854391ecb9f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4252a17..26cad94 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -51,6 +51,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0`save_config()` and `load_config()` make a best-effort `icacls` call onWindows to restrict `~/.config/claude-seo/backlinks-api.json` to thecurrent user, since POSIX mode bits do not restrict NTFS ACLs (#290).+- 17 scripts raise `sys.exit(1)` at import time when an optional dependency+ (`requests`, `bs4`, `playwright`, `googleapiclient`, `google.analytics`) is+ missing. Any test module that imports one of these at module scope aborted+ the whole pytest session on a minimal install instead of skipping. 8 of the+ 17 (`bing_webmaster`, `commoncrawl_graph`, `crux_history`, `fetch_page`,+ `moz_api`, `nlp_analyze`, `pagespeed_check`, `parse_html`) had test modules+ that needed the guard (`gsc_query`'s 3 test modules already had it; the+ other 8 of the 17 have no test module that imports them at module scope,+ so nothing to guard). `url_safety.py` itself hard-requires `requests`+ (by design), so every script that imports it transitively hits the same+ failure; guarded those test modules too (`domain_history`,+ `gbp_deprecation_lint`, `parasite_risk`, `agent_ux_check`/`render_page`,+ `indexnow_submit`, `url_safety`'s own suite, and the new+ `backlinks_auth` hardening tests). 17 test modules gained a+ `pytest.importorskip` guard in total. Verified in a throwaway venv with+ only `pytest` and `beautifulsoup4` installed: the suite completes (206+ passed, 24 skipped, no errors).## [2.2.6] - 2026-09-10diff --git a/tests/test_backlinks_auth_hardening.py b/tests/test_backlinks_auth_hardening.pyindex b91d509..784c07b 100644--- a/tests/test_backlinks_auth_hardening.py+++ b/tests/test_backlinks_auth_hardening.py@@ -21,6 +21,10 @@ _SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+# backlinks_auth.py unconditionally imports url_safety, which itself hard-requires+# requests (by design: no SSRF checks is worse than none). Skip cleanly rather+# than aborting collection when requests is not installed.+pytest.importorskip("requests")import backlinks_auth # noqa: E402diff --git a/tests/test_bing_webmaster.py b/tests/test_bing_webmaster.pyindex 6cd12c6..9317f2a 100644--- a/tests/test_bing_webmaster.py+++ b/tests/test_bing_webmaster.py@@ -12,6 +12,7 @@ import pytestROOT = Path(__file__).resolve().parents[1]sys.path.insert(0, str(ROOT / "scripts"))+pytest.importorskip("requests")import bing_webmaster as bing # noqa: E402diff --git a/tests/test_commoncrawl_graph.py b/tests/test_commoncrawl_graph.pyindex bc12d34..7c04661 100644--- a/tests/test_commoncrawl_graph.py+++ b/tests/test_commoncrawl_graph.py@@ -22,6 +22,7 @@ _SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+pytest.importorskip("requests")import commoncrawl_graph as ccg # noqa: E402diff --git a/tests/test_domain_history.py b/tests/test_domain_history.pyindex b676a65..d6d568f 100644--- a/tests/test_domain_history.py+++ b/tests/test_domain_history.py@@ -22,6 +22,7 @@ _SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+pytest.importorskip("requests")import domain_history as dh # noqa: E402diff --git a/tests/test_fetch_page_cli.py b/tests/test_fetch_page_cli.pyindex f3912cd..a1fc30e 100644--- a/tests/test_fetch_page_cli.py+++ b/tests/test_fetch_page_cli.py@@ -15,6 +15,7 @@ from pathlib import Pathimport pytestsys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))+pytest.importorskip("requests")import fetch_page # noqa: E402import render_page # noqa: E402diff --git a/tests/test_fetch_page_decoding.py b/tests/test_fetch_page_decoding.pyindex 2db6f3a..64f888c 100644--- a/tests/test_fetch_page_decoding.py+++ b/tests/test_fetch_page_decoding.py@@ -5,11 +5,14 @@ from __future__ import annotationsimport sysfrom pathlib import Path+import pytest+REPO_ROOT = Path(__file__).resolve().parents[1]SCRIPTS_DIR = REPO_ROOT / "scripts"if str(SCRIPTS_DIR) not in sys.path:sys.path.insert(0, str(SCRIPTS_DIR))+pytest.importorskip("requests")import fetch_page # noqa: E402diff --git a/tests/test_gbp_lint_and_polish.py b/tests/test_gbp_lint_and_polish.pyindex 5285c3e..75a6d65 100644--- a/tests/test_gbp_lint_and_polish.py+++ b/tests/test_gbp_lint_and_polish.py@@ -10,11 +10,14 @@ from __future__ import annotationsimport sysfrom pathlib import Path+import pytest+_REPO = Path(__file__).resolve().parents[1]_SCRIPTS = _REPO / "scripts"if str(_SCRIPTS) not in sys.path:sys.path.insert(0, str(_SCRIPTS))+pytest.importorskip("requests")import gbp_deprecation_lint as gbp # noqa: E402# ---------------------------------------------------------------------------diff --git a/tests/test_google_api_key_safety.py b/tests/test_google_api_key_safety.pyindex 15dc651..fdd7fcd 100644--- a/tests/test_google_api_key_safety.py+++ b/tests/test_google_api_key_safety.py@@ -12,13 +12,14 @@ import sysfrom types import SimpleNamespacefrom unittest.mock import patch-import requests+import pytest_SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "scripts")_REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+requests = pytest.importorskip("requests")import crux_history # noqa: E402import google_auth # noqa: E402import lcp_subparts # noqa: E402diff --git a/tests/test_lazy_detection.py b/tests/test_lazy_detection.pyindex 46c7689..af07783 100644--- a/tests/test_lazy_detection.py+++ b/tests/test_lazy_detection.py@@ -9,10 +9,16 @@ alone reports "not lazy-loaded" when the page is heavily lazy-loaded.import sysfrom pathlib import Path+import pytest+# Make scripts/ importable without requiring it to be a packageREPO_ROOT = Path(__file__).resolve().parent.parentsys.path.insert(0, str(REPO_ROOT / "scripts"))+pytest.importorskip("bs4")+# parse_html.py also unconditionally imports url_safety, which itself+# hard-requires requests.+pytest.importorskip("requests")from bs4 import BeautifulSoup # noqa: E402from parse_html import _detect_lazy_method, parse_html # noqa: E402diff --git a/tests/test_moz_api.py b/tests/test_moz_api.pyindex 831539c..6a65feb 100644--- a/tests/test_moz_api.py+++ b/tests/test_moz_api.py@@ -7,10 +7,13 @@ import osimport sysfrom unittest.mock import patch+import pytest+_SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "scripts")if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+pytest.importorskip("requests")import backlinks_auth # noqa: E402import moz_api # noqa: E402diff --git a/tests/test_nlp_analyze.py b/tests/test_nlp_analyze.pyindex b30c02b..a77df96 100644--- a/tests/test_nlp_analyze.py+++ b/tests/test_nlp_analyze.py@@ -6,10 +6,13 @@ import osimport sysfrom unittest.mock import patch+import pytest+_SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "scripts")if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+pytest.importorskip("requests")import nlp_analyze # noqa: E402diff --git a/tests/test_pagespeed_null_category_score.py b/tests/test_pagespeed_null_category_score.pyindex 53c1333..2fd4401 100644--- a/tests/test_pagespeed_null_category_score.py+++ b/tests/test_pagespeed_null_category_score.py@@ -11,9 +11,12 @@ import sysfrom pathlib import Pathfrom unittest import mock+import pytest+ROOT = Path(__file__).resolve().parents[1]sys.path.insert(0, str(ROOT / "scripts"))+pytest.importorskip("requests")import pagespeed_check # noqa: E402diff --git a/tests/test_parasite_risk_and_extensions.py b/tests/test_parasite_risk_and_extensions.pyindex 349ea98..2b97654 100644--- a/tests/test_parasite_risk_and_extensions.py+++ b/tests/test_parasite_risk_and_extensions.py@@ -19,6 +19,7 @@ _SCRIPTS = _REPO_ROOT / "scripts"if str(_SCRIPTS) not in sys.path:sys.path.insert(0, str(_SCRIPTS))+pytest.importorskip("requests")import parasite_risk # noqa: E402# ---------------------------------------------------------------------------diff --git a/tests/test_phase_j_executable.py b/tests/test_phase_j_executable.pyindex 95b3bde..832ef6d 100644--- a/tests/test_phase_j_executable.py+++ b/tests/test_phase_j_executable.py@@ -17,11 +17,14 @@ import sysfrom pathlib import Pathfrom unittest import mock+import pytest+_REPO_ROOT = Path(__file__).resolve().parents[1]_SCRIPTS = _REPO_ROOT / "scripts"if str(_SCRIPTS) not in sys.path:sys.path.insert(0, str(_SCRIPTS))+pytest.importorskip("requests")import agent_ux_check # noqa: E402import iptc_ai_label # noqa: E402import render_page # noqa: E402diff --git a/tests/test_render_page.py b/tests/test_render_page.pyindex 9c34c35..9031403 100644--- a/tests/test_render_page.py+++ b/tests/test_render_page.py@@ -30,6 +30,7 @@ _SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+pytest.importorskip("requests")import render_page # noqa: E402# ---------------------------------------------------------------------------diff --git a/tests/test_technical_depth.py b/tests/test_technical_depth.pyindex c47031a..810fc3a 100644--- a/tests/test_technical_depth.py+++ b/tests/test_technical_depth.py@@ -20,10 +20,13 @@ import sysfrom types import SimpleNamespacefrom unittest.mock import patch+import pytest+_SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "scripts")if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+pytest.importorskip("requests")import indexnow_submit # noqa: E402import lcp_subparts # noqa: E402import preload_check # noqa: E402diff --git a/tests/test_url_safety.py b/tests/test_url_safety.pyindex da6f467..3d9fd4a 100644--- a/tests/test_url_safety.py+++ b/tests/test_url_safety.py@@ -25,6 +25,7 @@ _SCRIPTS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__if _SCRIPTS not in sys.path:sys.path.insert(0, _SCRIPTS)+pytest.importorskip("requests")import url_safety # noqa: E402# ---------------------------------------------------------------------------