MCPcopy
hub / github.com/ArchiveBox/ArchiveBox / get_version

Function get_version

archivebox/config.py:385–398  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

383 return SYSTEM_USER
384
385def get_version(config):
386 try:
387 return importlib.metadata.version(__package__ or 'archivebox')
388 except importlib.metadata.PackageNotFoundError:
389 try:
390 pyproject_config = (config['PACKAGE_DIR'] / 'pyproject.toml').read_text()
391 for line in pyproject_config:
392 if line.startswith('version = '):
393 return line.split(' = ', 1)[-1].strip('"')
394 except FileNotFoundError:
395 # building docs, pyproject.toml is not available
396 return 'dev'
397
398 raise Exception('Failed to detect installed archivebox version!')
399
400def get_commit_hash(config) -> Optional[str]:
401 try:

Callers 2

config.pyFile · 0.85
versionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected