| 383 | return SYSTEM_USER |
| 384 | |
| 385 | def 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 | |
| 400 | def get_commit_hash(config) -> Optional[str]: |
| 401 | try: |