Skip to content

Commit

Permalink
Correct pip usage and notarization logging. (#2149)
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 authored Feb 6, 2025
1 parent 841a130 commit 90448eb
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 28 deletions.
1 change: 1 addition & 0 deletions changes/2149.bugfix.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Briefcase no longer uses the ``--no-python-version-warning`` option when invoking pip. This option has been deprecated, is currently a no-op, and will be removed soon.
1 change: 1 addition & 0 deletions changes/2149.bugfix.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Some error messages that are an expected part of the macOS notarization process are now hidden from default verbosity.
1 change: 0 additions & 1 deletion src/briefcase/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ def _pip_install(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down
4 changes: 4 additions & 0 deletions src/briefcase/platforms/macOS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ def submit_notarization(self, app, identity: SigningIdentity) -> str:
"--output-format",
"json",
],
quiet=1,
)
submission_id = submission["id"]
except subprocess.CalledProcessError as e:
Expand All @@ -991,6 +992,7 @@ def submit_notarization(self, app, identity: SigningIdentity) -> str:
if e.returncode == 69 and not store_credentials:
store_credentials = True
else:
self.tools.subprocess.output_error(e)
raise BriefcaseCommandError(
f"Unable to submit {filename.relative_to(self.base_path)} for notarization."
) from e
Expand Down Expand Up @@ -1080,6 +1082,7 @@ def finalize_notarization(
identity.profile,
submission_id,
],
quiet=1,
)

if response["status"] == "Accepted":
Expand Down Expand Up @@ -1110,6 +1113,7 @@ def finalize_notarization(
# notarization isn't complete yet. Try again in 10 seconds.
time.sleep(10)
else:
self.tools.subprocess.output_error(e)
raise BriefcaseCommandError(
"Unknown problem retrieving notarization status."
) from e
Expand Down
14 changes: 0 additions & 14 deletions tests/commands/create/test_install_app_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def test_app_packages_valid_requires(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -187,7 +186,6 @@ def test_app_packages_requirement_installer_args_no_paths(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -225,7 +223,6 @@ def test_app_packages_requirement_installer_args_path_transformed(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -264,7 +261,6 @@ def test_app_packages_requirement_installer_args_coincidental_path_not_transform
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -302,7 +298,6 @@ def test_app_packages_requirement_installer_args_path_not_transformed(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -341,7 +336,6 @@ def test_app_packages_requirement_installer_args_combined_argument_not_transform
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -381,7 +375,6 @@ def test_app_packages_valid_requires_no_support_package(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -430,7 +423,6 @@ def test_app_packages_invalid_requires(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -477,7 +469,6 @@ def test_app_packages_offline(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -528,7 +519,6 @@ def test_app_packages_install_requirements(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -584,7 +574,6 @@ def test_app_packages_replace_existing_requirements(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -996,7 +985,6 @@ def test_app_packages_test_requires(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -1036,7 +1024,6 @@ def test_app_packages_test_requires_test_mode(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down Expand Up @@ -1079,7 +1066,6 @@ def test_app_packages_only_test_requires_test_mode(
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={app_packages_path}",
Expand Down
2 changes: 0 additions & 2 deletions tests/platforms/iOS/xcode/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def test_extra_pip_args(create_command, first_app_generated, tmp_path):
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={bundle_path / 'app_packages.iphoneos'}",
Expand Down Expand Up @@ -93,7 +92,6 @@ def test_extra_pip_args(create_command, first_app_generated, tmp_path):
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={bundle_path / 'app_packages.iphonesimulator'}",
Expand Down
2 changes: 0 additions & 2 deletions tests/platforms/iOS/xcode/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def test_extra_pip_args(update_command, first_app_generated, tmp_path):
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={bundle_path / 'app_packages.iphoneos'}",
Expand Down Expand Up @@ -80,7 +79,6 @@ def test_extra_pip_args(update_command, first_app_generated, tmp_path):
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
f"--target={bundle_path / 'app_packages.iphonesimulator'}",
Expand Down
3 changes: 0 additions & 3 deletions tests/platforms/linux/test_LocalRequirementsMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def test_install_app_requirements_in_docker(create_command, first_app_config, tm
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
"--target=/app/path/to/app_packages",
Expand Down Expand Up @@ -232,7 +231,6 @@ def test_install_app_requirements_no_docker(
"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 @@ -333,7 +331,6 @@ def build_sdist(*args, **kwargs):
"pip",
"install",
"--disable-pip-version-check",
"--no-python-version-warning",
"--upgrade",
"--no-user",
"--target=/app/path/to/app_packages",
Expand Down
Loading

0 comments on commit 90448eb

Please sign in to comment.