Print the ArchiveBox version and dependency information
(quiet: bool=False,
out_dir: Path=OUTPUT_DIR)
| 216 | |
| 217 | @enforce_types |
| 218 | def version(quiet: bool=False, |
| 219 | out_dir: Path=OUTPUT_DIR) -> None: |
| 220 | """Print the ArchiveBox version and dependency information""" |
| 221 | |
| 222 | print(VERSION) |
| 223 | |
| 224 | if not quiet: |
| 225 | # 0.7.1 |
| 226 | # ArchiveBox v0.7.1+editable COMMIT_HASH=951bba5 BUILD_TIME=2023-12-17 16:46:05 1702860365 |
| 227 | # IN_DOCKER=False IN_QEMU=False ARCH=arm64 OS=Darwin PLATFORM=macOS-14.2-arm64-arm-64bit PYTHON=Cpython |
| 228 | # FS_ATOMIC=True FS_REMOTE=False FS_USER=501:20 FS_PERMS=644 |
| 229 | # DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND=ripgrep LDAP=False |
| 230 | |
| 231 | p = platform.uname() |
| 232 | print( |
| 233 | 'ArchiveBox v{}'.format(get_version(CONFIG)), |
| 234 | *((f'COMMIT_HASH={COMMIT_HASH[:7]}',) if COMMIT_HASH else ()), |
| 235 | f'BUILD_TIME={BUILD_TIME}', |
| 236 | ) |
| 237 | print( |
| 238 | f'IN_DOCKER={IN_DOCKER}', |
| 239 | f'IN_QEMU={IN_QEMU}', |
| 240 | f'ARCH={p.machine}', |
| 241 | f'OS={p.system}', |
| 242 | f'PLATFORM={platform.platform()}', |
| 243 | f'PYTHON={sys.implementation.name.title()}', |
| 244 | ) |
| 245 | OUTPUT_IS_REMOTE_FS = DATA_LOCATIONS['OUTPUT_DIR']['is_mount'] or DATA_LOCATIONS['ARCHIVE_DIR']['is_mount'] |
| 246 | print( |
| 247 | f'FS_ATOMIC={ENFORCE_ATOMIC_WRITES}', |
| 248 | f'FS_REMOTE={OUTPUT_IS_REMOTE_FS}', |
| 249 | f'FS_USER={PUID}:{PGID}', |
| 250 | f'FS_PERMS={OUTPUT_PERMISSIONS}', |
| 251 | ) |
| 252 | print( |
| 253 | f'DEBUG={DEBUG}', |
| 254 | f'IS_TTY={IS_TTY}', |
| 255 | f'TZ={TIMEZONE}', |
| 256 | f'SEARCH_BACKEND={SEARCH_BACKEND_ENGINE}', |
| 257 | f'LDAP={LDAP}', |
| 258 | #f'DB=django.db.backends.sqlite3 (({CONFIG["SQLITE_JOURNAL_MODE"]})', # add this if we have more useful info to show eventually |
| 259 | ) |
| 260 | print() |
| 261 | |
| 262 | print('{white}[i] Dependency versions:{reset}'.format(**ANSI)) |
| 263 | for name, dependency in DEPENDENCIES.items(): |
| 264 | print(printable_dependency_version(name, dependency)) |
| 265 | |
| 266 | # add a newline between core dependencies and extractor dependencies for easier reading |
| 267 | if name == 'ARCHIVEBOX_BINARY': |
| 268 | print() |
| 269 | |
| 270 | print() |
| 271 | print('{white}[i] Source-code locations:{reset}'.format(**ANSI)) |
| 272 | for name, path in CODE_LOCATIONS.items(): |
| 273 | print(printable_folder_status(name, path)) |
| 274 | |
| 275 | print() |
no test coverage detected