Skip to content

Commit 5b180d5

Browse files
authored
fix: drop deprecated Python module pkg_resources (#333)
1 parent eae394d commit 5b180d5

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

pylib/gyp/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import shlex
1414
import sys
1515
import traceback
16+
from importlib.metadata import version
1617

1718
import gyp.input
1819
from gyp.common import GypError
@@ -491,9 +492,7 @@ def gyp_main(args):
491492

492493
options, build_files_arg = parser.parse_args(args)
493494
if options.version:
494-
import pkg_resources # noqa: PLC0415
495-
496-
print(f"v{pkg_resources.get_distribution('gyp-next').version}")
495+
print(f"v{version('gyp-next')}")
497496
return 0
498497
build_files = build_files_arg
499498

pylib/gyp/mac_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
545545
# If the user has multiple provisioning profiles installed that can be
546546
# used for ${bundle_identifier}, pick the most specific one (ie. the
547547
# provisioning profile whose pattern is the longest).
548-
selected_key = max(valid_provisioning_profiles, key=lambda v: len(v))
548+
selected_key = max(valid_provisioning_profiles, key=len)
549549
return valid_provisioning_profiles[selected_key]
550550

551551
def _LoadProvisioningProfile(self, profile_path):

0 commit comments

Comments
 (0)