Skip to content

Commit 1ef2fda

Browse files
authored
Merge pull request #255 from tcdent/packaging-output
Add log output indicating that a package is being installed/upgraded/removed
2 parents afe916b + 3f5499f commit 1ef2fda

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

agentstack/packaging.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# When calling `uv` we explicitly specify the --python executable to use so that
1919
# the packages are installed into the correct virtual environment.
2020
# In testing, when this was not set, packages could end up in the pyenv's
21-
# site-packages directory; it's possible an environemnt variable can control this.
21+
# site-packages directory; it's possible an environment variable can control this.
2222

2323

2424
def install(package: str):
@@ -31,6 +31,7 @@ def on_progress(line: str):
3131
def on_error(line: str):
3232
log.error(f"uv: [error]\n {line.strip()}")
3333

34+
log.info(f"Installing {package}")
3435
_wrap_command_with_callbacks(
3536
[get_uv_bin(), 'add', '--python', '.venv/bin/python', package],
3637
on_progress=on_progress,
@@ -79,6 +80,7 @@ def on_progress(line: str):
7980
def on_error(line: str):
8081
log.error(f"uv: [error]\n {line.strip()}")
8182

83+
log.info(f"Uninstalling {requirement.name}")
8284
_wrap_command_with_callbacks(
8385
[get_uv_bin(), 'remove', '--python', '.venv/bin/python', requirement.name],
8486
on_progress=on_progress,
@@ -97,6 +99,7 @@ def on_progress(line: str):
9799
def on_error(line: str):
98100
log.error(f"uv: [error]\n {line.strip()}")
99101

102+
log.info(f"Upgrading {package}")
100103
_wrap_command_with_callbacks(
101104
[get_uv_bin(), 'pip', 'install', '-U', '--python', '.venv/bin/python', package],
102105
on_progress=on_progress,
@@ -105,7 +108,7 @@ def on_error(line: str):
105108

106109

107110
def create_venv(python_version: str = DEFAULT_PYTHON_VERSION):
108-
"""Intialize a virtual environment in the project directory of one does not exist."""
111+
"""Initialize a virtual environment in the project directory of one does not exist."""
109112
if os.path.exists(conf.PATH / VENV_DIR_NAME):
110113
return # venv already exists
111114

0 commit comments

Comments
 (0)