mirror of
https://github.com/smittix/intercept.git
synced 2026-06-20 19:28:26 -07:00
v2.26.0: fix SSE fanout crash and branded logo FOUC
- Fix SSE fanout thread AttributeError when source queue is None during interpreter shutdown by snapshotting to local variable with null guard - Fix branded "i" logo rendering oversized on first page load (FOUC) by adding inline width/height to SVG elements across 10 templates - Bump version to 2.26.0 in config.py, pyproject.toml, and CHANGELOG.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+16
-14
@@ -1,8 +1,10 @@
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
import importlib.metadata
|
||||
import tomllib
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import tomllib
|
||||
|
||||
|
||||
def get_root_path():
|
||||
return Path(__file__).parent.parent
|
||||
@@ -16,7 +18,7 @@ def parse_txt_requirements(file_path):
|
||||
if not file_path.exists():
|
||||
return set()
|
||||
packages = set()
|
||||
with open(file_path, "r") as f:
|
||||
with open(file_path) as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line or line.startswith(("#", "-e", "git+", "-r")):
|
||||
@@ -28,7 +30,7 @@ def parse_toml_section(data, section_type="main"):
|
||||
"""Extracts full requirement strings from pyproject.toml including optional sections."""
|
||||
packages = set()
|
||||
project = data.get("project", {})
|
||||
|
||||
|
||||
if section_type == "main":
|
||||
deps = project.get("dependencies", [])
|
||||
elif section_type == "optional":
|
||||
@@ -37,7 +39,7 @@ def parse_toml_section(data, section_type="main"):
|
||||
deps = project.get("optional-dependencies", {}).get("dev", [])
|
||||
if not deps:
|
||||
deps = data.get("dependency-groups", {}).get("dev", [])
|
||||
|
||||
|
||||
for req in deps:
|
||||
packages.add(_clean_string(req))
|
||||
return packages
|
||||
@@ -54,7 +56,7 @@ def test_dependency_files_integrity():
|
||||
# Validate Production Sync (Main + Optionals)
|
||||
txt_main = parse_txt_requirements(root / "requirements.txt")
|
||||
toml_main = parse_toml_section(toml_data, "main") | parse_toml_section(toml_data, "optional")
|
||||
|
||||
|
||||
assert txt_main == toml_main, (
|
||||
f"Production version mismatch!\n"
|
||||
f"Only in TXT: {txt_main - toml_main}\n"
|
||||
@@ -75,10 +77,10 @@ def test_environment_vs_toml():
|
||||
root = get_root_path()
|
||||
with open(root / "pyproject.toml", "rb") as f:
|
||||
data = tomllib.load(f)
|
||||
|
||||
|
||||
all_declared = (
|
||||
parse_toml_section(data, "main") |
|
||||
parse_toml_section(data, "optional") |
|
||||
parse_toml_section(data, "main") |
|
||||
parse_toml_section(data, "optional") |
|
||||
parse_toml_section(data, "dev")
|
||||
)
|
||||
_verify_installation(all_declared, "TOML")
|
||||
@@ -87,7 +89,7 @@ def test_environment_vs_requirements():
|
||||
"""3. Verifies that installed packages satisfy .txt requirements."""
|
||||
root = get_root_path()
|
||||
all_txt_deps = (
|
||||
parse_txt_requirements(root / "requirements.txt") |
|
||||
parse_txt_requirements(root / "requirements.txt") |
|
||||
parse_txt_requirements(root / "requirements-dev.txt")
|
||||
)
|
||||
_verify_installation(all_txt_deps, "requirements.txt")
|
||||
@@ -95,15 +97,15 @@ def test_environment_vs_requirements():
|
||||
def _verify_installation(package_set, source_name):
|
||||
"""Helper to check if declared versions match installed versions."""
|
||||
missing_or_wrong = []
|
||||
|
||||
|
||||
for req in package_set:
|
||||
# Split name from version
|
||||
parts = re.split(r'==|>=|~=|<=|>|<', req)
|
||||
raw_name = parts[0].strip()
|
||||
|
||||
|
||||
# CLEAN EXTRAS: "qrcode[pil]" -> "qrcode"
|
||||
clean_name = re.sub(r'\[.*\]', '', raw_name)
|
||||
|
||||
|
||||
try:
|
||||
installed_ver = importlib.metadata.version(clean_name)
|
||||
if "==" in req:
|
||||
|
||||
Reference in New Issue
Block a user