mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 14:44:18 +00:00
hide binary loading debug output for now
This commit is contained in:
parent
1e73a06ba0
commit
4ac980a832
1 changed files with 13 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
__package__ = 'archivebox.pkgs'
|
__package__ = 'archivebox.pkgs'
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import inspect
|
import inspect
|
||||||
|
@ -12,8 +13,9 @@ from django.db.backends.sqlite3.base import Database as sqlite3
|
||||||
from pydantic_pkgr import Binary, BinProvider, BrewProvider, EnvProvider, SemVer
|
from pydantic_pkgr import Binary, BinProvider, BrewProvider, EnvProvider, SemVer
|
||||||
from pydantic_pkgr.binprovider import bin_abspath
|
from pydantic_pkgr.binprovider import bin_abspath
|
||||||
|
|
||||||
|
from ..config import NODE_BIN_PATH, bin_path
|
||||||
|
|
||||||
env = EnvProvider()
|
env = EnvProvider(PATH=NODE_BIN_PATH + ':' + os.environ.get('PATH', '/bin'))
|
||||||
|
|
||||||
|
|
||||||
LOADED_DEPENDENCIES = {}
|
LOADED_DEPENDENCIES = {}
|
||||||
|
@ -51,6 +53,13 @@ for bin_key, dependency in settings.CONFIG.DEPENDENCIES.items():
|
||||||
'version': lambda: settings.CONFIG.VERSION,
|
'version': lambda: settings.CONFIG.VERSION,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
elif bin_name.endswith('postlight/parser/cli.js'):
|
||||||
|
binary_spec = Binary(name='postlight-parser', providers=[env], provider_overrides={
|
||||||
|
'env': {
|
||||||
|
'abspath': lambda: bin_path('postlight-parser'),
|
||||||
|
'version': lambda: SemVer('1.0.0'),
|
||||||
|
}
|
||||||
|
})
|
||||||
else:
|
else:
|
||||||
binary_spec = Binary(name=bin_name, providers=[env])
|
binary_spec = Binary(name=bin_name, providers=[env])
|
||||||
|
|
||||||
|
@ -67,10 +76,10 @@ for bin_key, dependency in settings.CONFIG.DEPENDENCIES.items():
|
||||||
assert str(binary.loaded_respath) == str(bin_abspath(dependency['path']).resolve()), f"Expected {bin_name} abspath {bin_abspath(dependency['path']).resolve()}, got {binary.loaded_respath}"
|
assert str(binary.loaded_respath) == str(bin_abspath(dependency['path']).resolve()), f"Expected {bin_name} abspath {bin_abspath(dependency['path']).resolve()}, got {binary.loaded_respath}"
|
||||||
assert binary.is_valid == dependency['is_valid'], f"Expected {bin_name} is_valid={dependency['is_valid']}, got {binary.is_valid}"
|
assert binary.is_valid == dependency['is_valid'], f"Expected {bin_name} is_valid={dependency['is_valid']}, got {binary.is_valid}"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Assertion error for {bin_name}: {e}")
|
print(f"WARNING: Error loading {bin_name}: {e}")
|
||||||
import ipdb; ipdb.set_trace()
|
# import ipdb; ipdb.set_trace()
|
||||||
|
|
||||||
print(f"- ✅ Binary {bin_name} loaded successfully")
|
# print(f"- ✅ Binary {bin_name} loaded successfully")
|
||||||
LOADED_DEPENDENCIES[bin_key] = binary
|
LOADED_DEPENDENCIES[bin_key] = binary
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue