From 1bf0304ac86b4c6e9aa8f50a72d62b96d740a4f4 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 00:03:56 +0000 Subject: [PATCH 1/3] fix(update): Use pip --upgrade in the update hint Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com> --- devservices/commands/update.py | 2 +- tests/commands/test_update.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/devservices/commands/update.py b/devservices/commands/update.py index 04de7ad4..c25359db 100644 --- a/devservices/commands/update.py +++ b/devservices/commands/update.py @@ -63,7 +63,7 @@ def update(_args: Namespace) -> None: console.warning( f"For example, update the line in requirements.txt to: devservices=={latest_version}" ) - console.warning("Then, run: pip install --update -r requirements.txt") + console.warning("Then, run: pip install --upgrade -r requirements.txt") return console.info("Upgrading to the latest version...") diff --git a/tests/commands/test_update.py b/tests/commands/test_update.py index b3271b20..c93c06f4 100644 --- a/tests/commands/test_update.py +++ b/tests/commands/test_update.py @@ -30,7 +30,7 @@ def test_update_in_virtualenv( "For example, update the line in requirements.txt to: devservices==1.0.0" in captured.out ) - assert "Then, run: pip install --update -r requirements.txt" in captured.out + assert "Then, run: pip install --upgrade -r requirements.txt" in captured.out @mock.patch("devservices.commands.update.metadata.version", return_value="0.0.1") From 8eb7f45a2e633792a00d146a5f0d7c21e9715392 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 00:04:52 +0000 Subject: [PATCH 2/3] fix(reset): Require a service name Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com> --- devservices/commands/reset.py | 2 -- tests/commands/test_reset.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/devservices/commands/reset.py b/devservices/commands/reset.py index 08bc034d..fe0e8693 100644 --- a/devservices/commands/reset.py +++ b/devservices/commands/reset.py @@ -30,8 +30,6 @@ def add_parser(subparsers: _SubParsersAction[ArgumentParser]) -> None: parser.add_argument( "service_name", help="Name of the service to reset volumes for", - nargs="?", - default=None, ) parser.set_defaults(func=reset) diff --git a/tests/commands/test_reset.py b/tests/commands/test_reset.py index e92c2664..eea0a373 100644 --- a/tests/commands/test_reset.py +++ b/tests/commands/test_reset.py @@ -1,11 +1,13 @@ from __future__ import annotations +from argparse import ArgumentParser from argparse import Namespace from pathlib import Path from unittest import mock import pytest +from devservices.commands.reset import add_parser from devservices.commands.reset import reset from devservices.constants import DEVSERVICES_ORCHESTRATOR_LABEL from devservices.exceptions import DockerDaemonNotRunningError @@ -15,6 +17,16 @@ from testing.utils import create_config_file +def test_reset_requires_service_name() -> None: + parser = ArgumentParser() + add_parser(parser.add_subparsers()) + + with pytest.raises(SystemExit): + parser.parse_args(["reset"]) + + assert parser.parse_args(["reset", "redis"]).service_name == "redis" + + @mock.patch( "devservices.commands.reset.get_matching_containers", side_effect=DockerDaemonNotRunningError(), From 440f2a03f099599c334d01aba31f76a3319da420 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 00:13:55 +0000 Subject: [PATCH 3/3] fix(update): Point the virtualenv update hint at uv instead of pip Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com> --- devservices/commands/update.py | 7 ++----- tests/commands/test_update.py | 9 +++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/devservices/commands/update.py b/devservices/commands/update.py index c25359db..5d7ad73a 100644 --- a/devservices/commands/update.py +++ b/devservices/commands/update.py @@ -58,12 +58,9 @@ def update(_args: Namespace) -> None: if is_in_virtualenv(): console.warning("You are running in a virtual environment.") console.warning( - "To update, please update your requirements.txt or requirements-dev.txt file with the new version." + f"To update, set the devservices requirement in your pyproject.toml to: devservices>={latest_version}" ) - console.warning( - f"For example, update the line in requirements.txt to: devservices=={latest_version}" - ) - console.warning("Then, run: pip install --upgrade -r requirements.txt") + console.warning("Then, run: uv lock --upgrade-package devservices && uv sync") return console.info("Upgrading to the latest version...") diff --git a/tests/commands/test_update.py b/tests/commands/test_update.py index c93c06f4..4a6e4b17 100644 --- a/tests/commands/test_update.py +++ b/tests/commands/test_update.py @@ -23,14 +23,11 @@ def test_update_in_virtualenv( captured = capsys.readouterr() assert "You are running in a virtual environment." in captured.out assert ( - "To update, please update your requirements.txt or requirements-dev.txt file with the new version." + "To update, set the devservices requirement in your pyproject.toml to: devservices>=1.0.0" in captured.out ) - assert ( - "For example, update the line in requirements.txt to: devservices==1.0.0" - in captured.out - ) - assert "Then, run: pip install --upgrade -r requirements.txt" in captured.out + assert "Then, run: uv lock --upgrade-package devservices && uv sync" in captured.out + assert "pip" not in captured.out @mock.patch("devservices.commands.update.metadata.version", return_value="0.0.1")