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 df364e0
Show file tree
Hide file tree
Showing 6 changed files with 31 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.
2 changes: 2 additions & 0 deletions src/briefcase/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ def _install_app_requirements(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down
18 changes: 18 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,8 @@ def test_app_packages_valid_requires(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -172,6 +174,8 @@ def test_app_packages_valid_requires_no_support_package(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -216,6 +220,8 @@ def test_app_packages_invalid_requires(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -267,6 +273,8 @@ def test_app_packages_offline(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -320,6 +328,8 @@ def test_app_packages_install_requirements(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -383,6 +393,8 @@ def test_app_packages_replace_existing_requirements(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -671,6 +683,8 @@ def test_app_packages_test_requires(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -715,6 +729,8 @@ def test_app_packages_test_requires_test_mode(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -762,6 +778,8 @@ def test_app_packages_only_test_requires_test_mode(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down
2 changes: 2 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,8 @@ def test_extra_pip_args(create_command, first_app_generated, tmp_path):
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={tmp_path / 'base_path' / 'build' / 'first-app' / 'ios' / 'xcode' / 'app_packages'}",
Expand Down
2 changes: 2 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,8 @@ def test_extra_pip_args(update_command, first_app_generated, tmp_path):
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={tmp_path / 'base_path' / 'build' / 'first-app' / 'ios' / 'xcode' / 'app_packages'}",
Expand Down
6 changes: 6 additions & 0 deletions tests/platforms/linux/test_LocalRequirementsMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def test_install_app_requirements_in_docker(create_command, first_app_config, tm
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
"--target=/app/path/to/app_packages",
Expand Down Expand Up @@ -230,6 +232,8 @@ def test_install_app_requirements_no_docker(
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={tmp_path}/base_path/build/first-app/tester/dummy/path/to/app_packages",
Expand Down Expand Up @@ -341,6 +345,8 @@ def build_sdist(*args, **kwargs):
"-m",
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
"--target=/app/path/to/app_packages",
Expand Down

0 comments on commit df364e0

Please sign in to comment.