The duplicate file names (advanced, agency, auth, compliance, costing, etc.) in both root and routers/ made imports ambiguous. Renamed root modules to pry_<name>.py so: from quality import X -> from pry_quality import X from routers.quality import router (unchanged) Also: - Renamed x402.py to pry_x402/ package directory - Fixed 21+ bare imports across api.py, deps.py, routers/, tests/, llm_providers/ Tests: 593 passed, 1 skipped (test_ready_returns_200 fails pre-existing because Ollama is unreachable from test env, unrelated to this refactor). Audit item 8.
32 lines
962 B
Python
32 lines
962 B
Python
"""Shared global instances for Pry API.
|
|
|
|
This module initializes the singleton instances used by all API routers
|
|
and should be imported by both api.py and any router module that needs
|
|
direct access to shared state.
|
|
|
|
Usage:
|
|
from deps import scraper, cache, automator, ...
|
|
"""
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
# Copyright (c) 2026 Rug Munch Media LLC
|
|
from __future__ import annotations
|
|
|
|
from pry_advanced import PryAdvanced
|
|
from automator import PryAutomator
|
|
from cache import ResponseCache
|
|
from extractor import SchemaExtractor
|
|
from jobqueue import JobQueue
|
|
from parser import DocumentParser
|
|
from ratelimit import RateLimiter
|
|
from scraper import PryScraper
|
|
from settings import settings
|
|
|
|
scraper = PryScraper()
|
|
automator = PryAutomator()
|
|
parser = DocumentParser()
|
|
extractor = SchemaExtractor()
|
|
cache = ResponseCache(capacity=1000)
|
|
ratelimiter = RateLimiter(default_rpm=settings.rate_limit_rpm, burst=200)
|
|
queue = JobQueue()
|
|
advanced = PryAdvanced(cache=cache)
|