Skip to content

Commit fc30505

Browse files
Merge pull request #3033 from blacklanternsecurity/fix-pip-installs
Install pip inside the bbot venv
2 parents e10a161 + 928b09d commit fc30505

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

bbot/core/helpers/depsinstaller/installer.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -268,24 +268,6 @@ async def pip_install(self, packages, constraints=None):
268268
packages_str = ",".join(packages)
269269
log.info(f"Installing the following pip packages: {packages_str}")
270270

271-
# Ensure pip is available in the environment
272-
try:
273-
check_pip_command = [sys.executable, "-m", "pip", "--version"]
274-
await self.parent_helper.run(check_pip_command, check=True)
275-
except CalledProcessError:
276-
# pip is not available, try to install it with ensurepip
277-
log.info("pip not found in virtual environment, attempting to install with ensurepip")
278-
try:
279-
ensurepip_command = [sys.executable, "-m", "ensurepip", "--upgrade"]
280-
await self.parent_helper.run(ensurepip_command, check=True)
281-
log.info("Successfully installed pip with ensurepip")
282-
except CalledProcessError as err:
283-
log.warning(
284-
f"Failed to install pip with ensurepip (return code {err.returncode}): {err.stderr}. "
285-
f"If using uv, create the virtual environment with 'uv venv --seed' or set UV_VENV_SEED=1"
286-
)
287-
return False
288-
289271
command = [sys.executable, "-m", "pip", "install", "--upgrade"] + packages
290272

291273
# if no custom constraints are provided, use the constraints of the currently installed version of bbot

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ classifiers = [
1515
"Topic :: Security",
1616
]
1717
dependencies = [
18+
"pip",
1819
"omegaconf>=2.3.0,<3",
1920
"psutil>=5.9.4,<8.0.0",
2021
"wordninja>=2.0.0,<3",

uv.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)