Spaces:
Running
Running
Commit History
-
Apply ruff formatting to Loguru migration files
ming +1: ClaudeAutomatic code formatting applied by ruff during pre-commit hook. These are cosmetic changes only (code style, no functional changes). Files formatted: - app/core/logging.py - tests/test_logging.py - tests/test_loguru_context.py - tests/test_loguru_integration.py - tests/test_loguru_setup.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>75fe59b -
Migrate logging from stdlib to Loguru for structured logging
ming +1: ClaudeThis migration replaces Python's standard logging module with Loguru, providing structured logging with automatic request ID propagation, environment-aware formatting, and improved developer experience. ## Changes ### Core Implementation - app/core/logging.py: Complete rewrite (224 lines) - Environment-aware formatting (JSON for prod, colored text for dev) - Context variables for automatic request ID propagation - Custom JSON serializer with structured fields - Backward-compatible get_logger() and RequestLogger APIs - app/core/middleware.py: - Integrated context var (request_id_var) for request ID injection - Automatic propagation eliminates manual parameter passing - app/core/config.py: - Added LOG_FORMAT setting (json/text/auto) with validator - Auto-detection based on HF_SPACE_ROOT_PATH environment - requirements.txt: - Added loguru>=0.7.0 dependency ### Testing (44 tests, 100% passing) - tests/test_loguru_context.py: Context variable propagation (7 tests) - …7ab470d -
Migrate to Ruff for linting/formatting and add comprehensive import tests
ming- Replace black, isort, and flake8 with ruff (Rust-based, 10-100x faster) - Add ruff.toml configuration with appropriate rules and ignores - Update pre-commit hook to run ruff check --fix and ruff format before tests - Update CLAUDE.md documentation with new ruff commands - Fix code style issues (nested if statements, formatting) - Add comprehensive import tests (test_imports.py) to catch import errors early - Fix config.py to ignore extra environment variables (prevents build failures) - Format all code with ruff (18 files reformatted) - Auto-fix 32 linting issues - Fix remaining test linting issues (B017, SIM117, B023) Benefits: - Single tool instead of three (black/isort/flake8) - Faster pre-commit hooks - Better CI/CD performance - Automatic import validation before deployment29ed661
-
feat: Implement V3 Web Scraping + Summarization API
ming✨ New Features: - Add V3 API endpoint: POST /api/v3/scrape-and-summarize/stream - Backend web scraping with trafilatura (95%+ success rate) - In-memory TTL-based caching (1 hour default, configurable) - User-agent rotation to avoid anti-scraping measures - Metadata extraction (title, author, date, site_name) - SSRF protection (blocks localhost and private IPs) - Streaming SSE response with metadata + content chunks 📦 New Components: - ArticleScraperService: High-quality article extraction - SimpleCache: In-memory cache with TTL and max size - V3 Router: Complete API implementation with validation - V3 Schemas: Request/response models with security validators 🧪 Testing: - 30 new tests (100% passing) - Cache tests: TTL, expiration, thread safety - Scraper tests: Success, timeouts, validation - API tests: Security (SSRF), error handling, streaming format 📝 Documentation: - Updated CLAUDE.md with V3 details - Updated README.md with V3 usage examples - Added V3_SCRAPING_IMPLEMENTATION…2ed2bd7
-
test: complete comprehensive test suite with 95% coverage
ming- Enhanced configuration tests with validation scenarios - Added comprehensive error handling tests - Added middleware functionality tests - Added logging setup tests - Fixed all test failures and improved coverage - Achieved 95% test coverage across all modules - All 48 tests passing successfully Coverage breakdown: - Core modules: 100% coverage - API endpoints: 100% coverage - Services: 92% coverage - Middleware: 92% coverage - Main app: 83% coverage2aa2b79