Versioning
provide.foundation.utils.versioning
¶
TODO: Add module docstring.
Functions¶
get_version
¶
Get the version for a package.
Reads from VERSION file if it exists, otherwise falls back to package metadata, then to default development version.
This function is thread-safe and caches results after the first call per package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_name
|
str
|
The package name as it appears in PyPI (e.g., "provide-foundation") |
required |
caller_file
|
str | Path | None
|
Path to the calling module's file, used to find VERSION file. If None, uses the calling context. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The current version string |
Source code in provide/foundation/utils/versioning.py
reset_version_cache
¶
Reset the cached version for testing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_name
|
str | None
|
Specific package to reset, or None to reset all |
None
|
Warning
This should only be called from test code or test fixtures.