return placeholder version during docs build
This commit is contained in:
parent
d3d05f5f64
commit
6188dcdcbd
1 changed files with 8 additions and 4 deletions
|
@ -380,10 +380,14 @@ def get_version(config):
|
||||||
try:
|
try:
|
||||||
return importlib.metadata.version(__package__ or 'archivebox')
|
return importlib.metadata.version(__package__ or 'archivebox')
|
||||||
except importlib.metadata.PackageNotFoundError:
|
except importlib.metadata.PackageNotFoundError:
|
||||||
pyproject_config = (config['PACKAGE_DIR'] / 'pyproject.toml').read_text()
|
try:
|
||||||
for line in pyproject_config:
|
pyproject_config = (config['PACKAGE_DIR'] / 'pyproject.toml').read_text()
|
||||||
if line.startswith('version = '):
|
for line in pyproject_config:
|
||||||
return line.split(' = ', 1)[-1].strip('"')
|
if line.startswith('version = '):
|
||||||
|
return line.split(' = ', 1)[-1].strip('"')
|
||||||
|
except FileNotFoundError:
|
||||||
|
# building docs, pyproject.toml is not available
|
||||||
|
return 'dev'
|
||||||
|
|
||||||
raise Exception('Failed to detect installed archivebox version!')
|
raise Exception('Failed to detect installed archivebox version!')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue