Reference¶
The Reference section contains the complete technical documentation for GitVersioned — API classes and configuration options. This is the section to bookmark when you need to look something up.
In This Section¶
API Reference
Auto-generated documentation for all public classes, methods, and modules.
Configuration Schema
All supported configuration file options, types, defaults, and examples.
Test Coverage
Run hatch run test:all-cov to generate HTML reports locally, or view the latest pipeline runs:
Python API Usage¶
While gitversioned is primarily used as a build plugin, it can also be used programmatically in your own Python scripts:
from gitversioned import Settings, resolve_version
from gitversioned.utils import BuildEnvironment, GitRepository
# Resolve the version using default settings
version, ref = resolve_version(
Settings(), GitRepository(), BuildEnvironment()
)
print(f"Resolved version: {version}")
# Or pass custom settings
custom_settings = Settings(package_name="my_pkg", source_type=["commit"])
version, ref = resolve_version(
custom_settings, GitRepository(), BuildEnvironment()
)
Generating Reference Docs¶
This project is pre-configured to work with mkdocstrings for auto-generating API documentation from docstrings.
Setup¶
[!NOTE]
mkdocstringssupports multiple languages via handlers (e.g., Python, C++, Crystal). See the mkdocstrings documentation to configure it for your language.
- The plugin and its Python handler are already managed by Hatch in the
docsenvironment (mkdocstrings[python]). - Configure
mkdocs.ymlaccording to your language handler and create your reference pages.