progfigsite root members

A site’s root __init__.py must contain the following:

site_name

The name of the Python package, e.g. example_site. Must match the name of the package in pyproject.toml.

site_description

A longer user-facing string.

get_version()

A function that takes no arguments and returns a valid pip version number.

This function should return the current version number, for the currently-running package. (This is different from the mint_version() function in progfigsite inventory module, which returns the next version number for a new build.)

It should first look for a builddata.version package with a string version member and return that. If that is not found, it should return a default version number.

Here is an example root __init__.py file from example_site.

"""The root module for the progfigsite package.

Should not reference progfiguration core.
"""


site_name = "example_site"
"""The name of the site package

This must match the name of the site package defined in pyproject.toml.
"""

site_description = "This site is bundled with progfiguration core as an example"
"""The description of the site"""


def get_version() -> str:
    """Dynamically get the package version."""
    try:
        from example_site.builddata import version as builddata_version

        return builddata_version.version
    except Exception as exc:
        return "0.0.1a0"