diff --git a/scripts/ga/ga_common.py b/scripts/ga/ga_common.py index 4bc7835..f525260 100644 --- a/scripts/ga/ga_common.py +++ b/scripts/ga/ga_common.py @@ -17,7 +17,10 @@ from pathlib import Path from urllib.parse import quote, urlsplit -import tomllib +try: # tomllib is stdlib from 3.11; `tomli` is a dev dependency below that (see pyproject.toml). + import tomllib +except ModuleNotFoundError: + import tomli as tomllib REPO_ROOT = Path(__file__).resolve().parent.parent.parent USER_AGENT = "wave-ga-evidence-sdk-python/1.0" diff --git a/scripts/release/check_drift.py b/scripts/release/check_drift.py index 75874d4..b67f21a 100644 --- a/scripts/release/check_drift.py +++ b/scripts/release/check_drift.py @@ -26,8 +26,9 @@ 2 a source was unreadable (network error, bad JSON, git/gh failure) -- an unreadable registry is NEVER treated as "in sync" -Stdlib + `git`/`gh` CLI only. No third-party imports so this runs identically -in CI and on a laptop with nothing but Python 3.11+ and the GitHub CLI. +Stdlib + `git`/`gh` CLI only (plus `tomli` as a dev dependency below Python 3.11, where `tomllib` +isn't stdlib yet) so this runs identically in CI and on a laptop with the GitHub CLI, across the +full `requires-python = ">=3.9"` matrix this package supports. """ from __future__ import annotations @@ -40,7 +41,10 @@ import urllib.request from pathlib import Path -import tomllib +try: # tomllib is stdlib from 3.11; `tomli` is a dev dependency below that (see pyproject.toml). + import tomllib +except ModuleNotFoundError: + import tomli as tomllib PYPI_PROJECT = "wave-sdk" GITHUB_REPO = "wave-av/sdk-python"