feat: decouple market from shared_lib, add app-owned models

Phase 1-3 of decoupling:
- path_setup.py adds project root to sys.path
- Market-owned models in market/models/ (market, market_place)
- All imports updated: shared.infrastructure, shared.db, shared.browser, etc.
- MarketPlace uses container_type/container_id instead of post_id FK

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-11 12:46:32 +00:00
parent 41b4e0fe24
commit 478636f799
51 changed files with 604 additions and 93 deletions

View File

@@ -7,9 +7,9 @@ from typing import Dict, Set
from ..http_client import configure_cookies
from ..get_auth import login
from config import config
from shared.config import config
from utils import log
from shared.utils import log
# DB: persistence helpers

View File

@@ -3,7 +3,7 @@ from bs4 import BeautifulSoup
from urllib.parse import urlparse, urljoin
from ._anchor_text import _anchor_text
from suma_browser.app.bp.browse.services.slugs import product_slug_from_href
from bp.browse.services.slugs import product_slug_from_href
from .APP_ROOT_PLACEHOLDER import APP_ROOT_PLACEHOLDER
def _rewrite_links_fragment(

View File

@@ -1,6 +1,6 @@
from urllib.parse import urljoin
from config import config
from utils import log
from shared.config import config
from shared.utils import log
from ...listings import scrape_products
async def capture_category(

View File

@@ -1,7 +1,7 @@
from typing import Dict, Set
from .capture_category import capture_category
from .capture_sub import capture_sub
from config import config
from shared.config import config
async def capture_product_slugs(

View File

@@ -1,7 +1,7 @@
from urllib.parse import urljoin
from urllib.parse import urljoin
from config import config
from utils import log
from shared.config import config
from shared.utils import log
from ...listings import scrape_products
async def capture_sub(

View File

@@ -6,12 +6,12 @@ import httpx
from ...html_utils import to_fragment
from suma_browser.app.bp.browse.services.slugs import suma_href_from_html_slug
from bp.browse.services.slugs import suma_href_from_html_slug
from config import config
from utils import log
from shared.config import config
from shared.utils import log
# DB: persistence helpers
from ...product.product_detail import scrape_product_detail

View File

@@ -1,7 +1,7 @@
import asyncio
from typing import Dict, List, Set
from config import config
from utils import log
from shared.config import config
from shared.utils import log
from .fetch_and_upsert_product import fetch_and_upsert_product

View File

@@ -1,7 +1,7 @@
from typing import Dict
from urllib.parse import urljoin
from config import config
from shared.config import config
def rewrite_nav(nav: Dict[str, Dict], nav_redirects:Dict[str, str]):
if nav_redirects: