
- Add ServerSettings class with pydantic-settings for type-safe configuration - Support multiple PyPI mirror sources with priority-based fallback mechanism - Implement RepositoryConfig and RepositoryManager for multi-repository support - Add environment variable support for all configuration options - Include private repository authentication configuration - Add advanced dependency analysis settings (max depth, concurrency, security) - Provide secure credential management with sensitive data masking - Update documentation and configuration examples - Add comprehensive test suite with 23 test cases covering all features - Include demo script showcasing multi-mirror configuration capabilities Configuration features: - Primary, additional, and fallback index URLs - Automatic duplicate URL removal with priority preservation - Runtime configuration reloading - Integration with repository manager for seamless multi-source queries Signed-off-by: longhao <hal.long@outlook.com>
37 lines
1004 B
Python
37 lines
1004 B
Python
# Import built-in modules
|
|
import os
|
|
|
|
# Import third-party modules
|
|
import nox
|
|
|
|
from nox_actions.utils import PACKAGE_NAME, THIS_ROOT
|
|
|
|
|
|
def pytest(session: nox.Session) -> None:
|
|
"""Run pytest with coverage reporting."""
|
|
session.install(".")
|
|
session.install("pytest", "pytest-cov", "pytest-mock", "pytest-asyncio")
|
|
test_root = os.path.join(THIS_ROOT, "tests")
|
|
session.run(
|
|
"pytest",
|
|
f"--cov={PACKAGE_NAME}",
|
|
"--cov-report=xml:coverage.xml",
|
|
"--cov-report=term-missing",
|
|
f"--rootdir={test_root}",
|
|
env={"PYTHONPATH": THIS_ROOT.as_posix()},
|
|
)
|
|
|
|
|
|
def mypy(session: nox.Session) -> None:
|
|
"""Run mypy type checking."""
|
|
session.install(".")
|
|
session.install("mypy", "types-requests")
|
|
session.run("mypy", PACKAGE_NAME, "--ignore-missing-imports")
|
|
|
|
|
|
def safety(session: nox.Session) -> None:
|
|
"""Run safety security checks."""
|
|
session.install(".")
|
|
session.install("safety")
|
|
session.run("safety", "check", "--json")
|