"""
Package version tracking framework.

This module provides tools for tracking git commit hashes of installed
packages, with support for multiple detection methods:

1. Build info (_build_info.py) - Generated by git hook, committed to source
2. PEP 610 (pip install git+...) - Reads direct_url.json metadata
3. Git runtime - Runs git commands for editable installs

Example usage:
    from appinfra.version import PackageVersionTracker

    tracker = PackageVersionTracker()
    tracker.track("mylib", "otherlib")

    for name, info in tracker.get_all().items():
        print(f"{name}: {info.version} @ {info.commit}")

For AppBuilder integration, use the .version configurer:
    app = (AppBuilder("myapp")
        .version
            .with_semver("1.0.0")
            .with_build_info()
            .with_package("mylib")
            .done()
        .build())
"""

from .actions import VersionWithTrackerAction
from .info import BuildInfo, PackageVersionInfo
from .setup_hook import generate_standalone_setup, get_stub_content, make_build_py_class
from .sources import BuildInfoSource, GitRuntimeSource, PEP610Source, VersionSource
from .tracker import PackageVersionTracker

__all__ = [
    "BuildInfo",
    "PackageVersionInfo",
    "PackageVersionTracker",
    "VersionSource",
    "PEP610Source",
    "BuildInfoSource",
    "GitRuntimeSource",
    "VersionWithTrackerAction",
    "make_build_py_class",
    "get_stub_content",
    "generate_standalone_setup",
]
