bittensor.utils.version#

Attributes#

Exceptions#

VersionCheckError

Exception raised for errors in the version check process.

Functions#

_get_version_file_path()

_get_version_from_file(version_file)

_get_version_from_pypi([timeout])

check_version([timeout])

Check if the current version of Bittensor is up-to-date with the latest version on PyPi.

get_and_save_latest_version([timeout])

Retrieves and saves the latest version of Bittensor.

version_checking([timeout])

Deprecated, kept for backwards compatibility. Use check_version() instead.

Module Contents#

bittensor.utils.version.VERSION_CHECK_THRESHOLD = 86400#
exception bittensor.utils.version.VersionCheckError#

Bases: Exception

Exception raised for errors in the version check process.

Initialize self. See help(type(self)) for accurate signature.

bittensor.utils.version._get_version_file_path()#
Return type:

pathlib.Path

bittensor.utils.version._get_version_from_file(version_file)#
Parameters:

version_file (pathlib.Path)

Return type:

Optional[str]

bittensor.utils.version._get_version_from_pypi(timeout=15)#
Parameters:

timeout (int)

Return type:

str

bittensor.utils.version.check_version(timeout=15)#

Check if the current version of Bittensor is up-to-date with the latest version on PyPi. Raises a VersionCheckError if the version check fails.

Parameters:

timeout (int) – The timeout for the request to PyPI in seconds. Default is 15.

bittensor.utils.version.get_and_save_latest_version(timeout=15)#

Retrieves and saves the latest version of Bittensor.

Parameters:

timeout (int) – The timeout for the request to PyPI in seconds. Default is 15.

Returns:

The latest version of Bittensor.

Return type:

str

bittensor.utils.version.version_checking(timeout=15)#

Deprecated, kept for backwards compatibility. Use check_version() instead.

Parameters:

timeout (int) – The timeout for calling :func:check_version function. Default is 15.