mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
never attempt to create system venv, install ldap in lib automatically, and setup binproviders before bins
This commit is contained in:
parent
3e4a846488
commit
584abe8548
6 changed files with 30 additions and 8 deletions
|
@ -59,6 +59,10 @@ class VenvPipBinProvider(PipProvider, BaseBinProvider):
|
|||
INSTALLER_BIN: BinName = "pip"
|
||||
|
||||
pip_venv: Optional[Path] = Path(os.environ.get("VIRTUAL_ENV", None) or '/tmp/NotInsideAVenv')
|
||||
|
||||
def setup(self):
|
||||
"""never attempt to create a venv here, this is just used to detect if we are inside an existing one"""
|
||||
return None
|
||||
|
||||
|
||||
class LibPipBinProvider(PipProvider, BaseBinProvider):
|
||||
|
@ -75,7 +79,8 @@ 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))
|
||||
if os.environ.get("VIRTUAL_ENV", None):
|
||||
sys.path.append(str(VENV_PIP_BINPROVIDER.pip_venv / site_packages_dir))
|
||||
sys.path.append(str(LIB_PIP_BINPROVIDER.pip_venv / site_packages_dir))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue