refactor: rename sessions submodule to _sessions to avoid shadowing sessions()

wabot/__init__.py defines def sessions(...) and also had a sessions.py
submodule, so wabot.sessions (attribute) resolved to the function,
shadowing the module for import wabot.sessions as m style access. This
is the same class of collision that browser.py -> _browser.py already
fixed. Renaming to _sessions.py removes the ambiguity and lets
docs/api.rst drop the :no-index: Sphinx workaround in favor of plain
autoclass directives on the public SessionRecord/SessionStore
re-exports.
This commit is contained in:
Mathew Sir Guest the best
2026-07-12 15:37:56 -06:00
parent 68978a34e7
commit 154344e94a
8 changed files with 26 additions and 21 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ from unittest.mock import MagicMock
import pytest
import wabot
from wabot.sessions import SessionRecord, SessionStore
from wabot import SessionRecord, SessionStore
@pytest.fixture
+2 -2
View File
@@ -1,6 +1,6 @@
from datetime import datetime, timedelta, timezone
from wabot.sessions import SessionRecord, SessionStore
from wabot._sessions import SessionRecord, SessionStore
def make_record(name="scraper1", created_at=None):
@@ -63,7 +63,7 @@ class TestSessionStore:
assert store.get("scraper1") is not None
def test_default_path_is_under_platformdirs(self):
from wabot.sessions import default_store_path
from wabot._sessions import default_store_path
assert default_store_path().name == "sessions.json"
assert "wabot" in str(default_store_path())