diff --git a/pylib/gyp/__init__.py b/pylib/gyp/__init__.py index 3a70cf07..c0a2637e 100755 --- a/pylib/gyp/__init__.py +++ b/pylib/gyp/__init__.py @@ -13,6 +13,7 @@ import shlex import sys import traceback +from importlib.metadata import version import gyp.input from gyp.common import GypError @@ -491,9 +492,7 @@ def gyp_main(args): options, build_files_arg = parser.parse_args(args) if options.version: - import pkg_resources # noqa: PLC0415 - - print(f"v{pkg_resources.get_distribution('gyp-next').version}") + print(f"v{version('gyp-next')}") return 0 build_files = build_files_arg diff --git a/pylib/gyp/mac_tool.py b/pylib/gyp/mac_tool.py index 3710178e..4c38f058 100755 --- a/pylib/gyp/mac_tool.py +++ b/pylib/gyp/mac_tool.py @@ -545,7 +545,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier): # If the user has multiple provisioning profiles installed that can be # used for ${bundle_identifier}, pick the most specific one (ie. the # provisioning profile whose pattern is the longest). - selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) + selected_key = max(valid_provisioning_profiles, key=len) return valid_provisioning_profiles[selected_key] def _LoadProvisioningProfile(self, profile_path):