Skip to content

Commit

Permalink
Disable pip warnings/checks during requires install
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Jul 22, 2023
1 parent 405c8b6 commit a451426
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/1375.misc.rst
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions src/briefcase/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
27 changes: 27 additions & 0 deletions tests/commands/create/test_install_app_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down
3 changes: 3 additions & 0 deletions tests/platforms/iOS/xcode/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}",
Expand Down
3 changes: 3 additions & 0 deletions tests/platforms/iOS/xcode/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}",
Expand Down
9 changes: 9 additions & 0 deletions tests/platforms/linux/test_LocalRequirementsMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit a451426

Please sign in to comment.