include sonic-client by default and allow ldap to be installed at runtime

This commit is contained in:
Nick Sweeting
2024-10-05 03:11:48 -07:00
parent 358e553328
commit 35446ce742
5 changed files with 38 additions and 1 deletions

View File

@@ -155,6 +155,7 @@ class ConstantsDict(Mapping):
".DS_Store",
".env",
"Dockerfile",
".ArchiveBox.conf.bak",
))
PIP_RELATED_NAMES: frozenset[str] = frozenset((
".venv",

View File

@@ -30,10 +30,12 @@ class LdapBinary(BaseBinary):
VENV_PIP_BINPROVIDER.name: {
"abspath": lambda: LDAP_LIB() and Path(inspect.getfile(LDAP_LIB())), # type: ignore
"version": lambda: LDAP_LIB() and SemVer(LDAP_LIB().__version__), # type: ignore
"packages": lambda: ['archivebox[ldap]'],
},
SYS_PIP_BINPROVIDER.name: {
"abspath": lambda: LDAP_LIB() and Path(inspect.getfile(LDAP_LIB())), # type: ignore
"version": lambda: LDAP_LIB() and SemVer(LDAP_LIB().__version__), # type: ignore
"packages": lambda: ['archivebox[ldap]'],
},
}

View File

@@ -73,6 +73,11 @@ VENV_PIP_BINPROVIDER = VenvPipBinProvider()
LIB_PIP_BINPROVIDER = LibPipBinProvider()
pip = LIB_PIP_BINPROVIDER
# ensure python libraries are importable from these locations (if archivebox wasnt executed from one of these then they wont already be in sys.path)
site_packages_dir = 'lib/python{}.{}/site-packages'.format(*sys.version_info[:2])
sys.path.append(str(VENV_PIP_BINPROVIDER.pip_venv / site_packages_dir))
sys.path.append(str(LIB_PIP_BINPROVIDER.pip_venv / site_packages_dir))
class ArchiveboxBinary(BaseBinary):
name: BinName = 'archivebox'