diff --git a/changes/1375.misc.rst b/changes/1375.misc.rst new file mode 100644 index 000000000..38230a551 --- /dev/null +++ b/changes/1375.misc.rst @@ -0,0 +1 @@ +To avoid spurious warnings, pip's version checks and "running as root" warning were disabled while an app's requirements are installed. diff --git a/src/briefcase/commands/create.py b/src/briefcase/commands/create.py index 05ef87058..73c0dabb2 100644 --- a/src/briefcase/commands/create.py +++ b/src/briefcase/commands/create.py @@ -479,6 +479,9 @@ def _install_app_requirements( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", diff --git a/tests/commands/create/test_install_app_requirements.py b/tests/commands/create/test_install_app_requirements.py index 97cd61fdf..e04fb28d2 100644 --- a/tests/commands/create/test_install_app_requirements.py +++ b/tests/commands/create/test_install_app_requirements.py @@ -123,6 +123,9 @@ def test_app_packages_valid_requires( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -172,6 +175,9 @@ def test_app_packages_valid_requires_no_support_package( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -216,6 +222,9 @@ def test_app_packages_invalid_requires( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -267,6 +276,9 @@ def test_app_packages_offline( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -320,6 +332,9 @@ def test_app_packages_install_requirements( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -383,6 +398,9 @@ def test_app_packages_replace_existing_requirements( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -671,6 +689,9 @@ def test_app_packages_test_requires( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -715,6 +736,9 @@ def test_app_packages_test_requires_test_mode( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", @@ -762,6 +786,9 @@ def test_app_packages_only_test_requires_test_mode( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={app_packages_path}", diff --git a/tests/platforms/iOS/xcode/test_create.py b/tests/platforms/iOS/xcode/test_create.py index 38ca71b4f..f2cccfcbb 100644 --- a/tests/platforms/iOS/xcode/test_create.py +++ b/tests/platforms/iOS/xcode/test_create.py @@ -48,6 +48,9 @@ def test_extra_pip_args(create_command, first_app_generated, tmp_path): "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={tmp_path / 'base_path' / 'build' / 'first-app' / 'ios' / 'xcode' / 'app_packages'}", diff --git a/tests/platforms/iOS/xcode/test_update.py b/tests/platforms/iOS/xcode/test_update.py index 8d0a3802e..ee53808b2 100644 --- a/tests/platforms/iOS/xcode/test_update.py +++ b/tests/platforms/iOS/xcode/test_update.py @@ -35,6 +35,9 @@ def test_extra_pip_args(update_command, first_app_generated, tmp_path): "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={tmp_path / 'base_path' / 'build' / 'first-app' / 'ios' / 'xcode' / 'app_packages'}", diff --git a/tests/platforms/linux/test_LocalRequirementsMixin.py b/tests/platforms/linux/test_LocalRequirementsMixin.py index 50e4887cf..52860f5df 100644 --- a/tests/platforms/linux/test_LocalRequirementsMixin.py +++ b/tests/platforms/linux/test_LocalRequirementsMixin.py @@ -177,6 +177,9 @@ def test_install_app_requirements_in_docker(create_command, first_app_config, tm "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", "--target=/app/path/to/app_packages", @@ -230,6 +233,9 @@ def test_install_app_requirements_no_docker( "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", f"--target={tmp_path}/base_path/build/first-app/tester/dummy/path/to/app_packages", @@ -341,6 +347,9 @@ def build_sdist(*args, **kwargs): "-m", "pip", "install", + "--disable-pip-version-check", + "--no-python-version-warning", + "--root-user-action=ignore", "--upgrade", "--no-user", "--target=/app/path/to/app_packages",