From 1b67fd43d2de1a537c368cb0ad6341f45ee63d11 Mon Sep 17 00:00:00 2001 From: nodejs-github-bot <18269663+nodejs-github-bot@users.noreply.github.com> Date: Sun, 19 Oct 2025 00:38:47 +0000 Subject: [PATCH] tools: update gyp-next to 0.20.5 --- tools/gyp/CHANGELOG.md | 8 ++++++++ tools/gyp/pylib/gyp/generator/android.py | 2 +- tools/gyp/pylib/gyp/generator/compile_commands_json.py | 2 +- tools/gyp/pylib/gyp/generator/gypd.py | 2 +- tools/gyp/pylib/gyp/generator/make.py | 2 +- tools/gyp/pylib/gyp/generator/msvs.py | 6 +++--- tools/gyp/pylib/gyp/generator/xcode.py | 8 ++++---- tools/gyp/pylib/gyp/input.py | 2 +- tools/gyp/pylib/gyp/xcode_emulation.py | 8 +++++--- tools/gyp/pylib/gyp/xcode_ninja.py | 2 +- tools/gyp/pylib/gyp/xcodeproj_file.py | 10 +++++----- tools/gyp/pyproject.toml | 2 +- tools/gyp/tools/graphviz.py | 6 +++--- 13 files changed, 35 insertions(+), 25 deletions(-) diff --git a/tools/gyp/CHANGELOG.md b/tools/gyp/CHANGELOG.md index 69449c0d8049e7..74dbc82832719c 100644 --- a/tools/gyp/CHANGELOG.md +++ b/tools/gyp/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.20.5](https://github.com/nodejs/gyp-next/compare/v0.20.4...v0.20.5) (2025-10-13) + + +### Bug Fixes + +* Fix ruff v0.13.0 adds ruff rule RUF059 ([bd4491a](https://github.com/nodejs/gyp-next/commit/bd4491a3ba641eeb040b785bbce367f72c3baf19)) +* handle `None` case in xcode_emulation regexes ([#311](https://github.com/nodejs/gyp-next/issues/311)) ([b21ee31](https://github.com/nodejs/gyp-next/commit/b21ee3150eea9fc1a8811e910e5ba64f42e1fb77)) + ## [0.20.4](https://github.com/nodejs/gyp-next/compare/v0.20.3...v0.20.4) (2025-08-25) diff --git a/tools/gyp/pylib/gyp/generator/android.py b/tools/gyp/pylib/gyp/generator/android.py index cfc0681f6bb049..5d5cae2afbf668 100644 --- a/tools/gyp/pylib/gyp/generator/android.py +++ b/tools/gyp/pylib/gyp/generator/android.py @@ -378,7 +378,7 @@ def WriteRules(self, rules, extra_sources, extra_outputs): inputs = rule.get("inputs") for rule_source in rule.get("rule_sources", []): (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = os.path.splitext( + (rule_source_root, _rule_source_ext) = os.path.splitext( rule_source_basename ) diff --git a/tools/gyp/pylib/gyp/generator/compile_commands_json.py b/tools/gyp/pylib/gyp/generator/compile_commands_json.py index bebb1303154e16..1361aeca48d0cd 100644 --- a/tools/gyp/pylib/gyp/generator/compile_commands_json.py +++ b/tools/gyp/pylib/gyp/generator/compile_commands_json.py @@ -100,7 +100,7 @@ def resolve(filename): def GenerateOutput(target_list, target_dicts, data, params): per_config_commands = {} for qualified_target, target in target_dicts.items(): - build_file, target_name, toolset = gyp.common.ParseQualifiedTarget( + build_file, _target_name, _toolset = gyp.common.ParseQualifiedTarget( qualified_target ) if IsMac(params): diff --git a/tools/gyp/pylib/gyp/generator/gypd.py b/tools/gyp/pylib/gyp/generator/gypd.py index 3c70b81fd25625..89af24a201b101 100644 --- a/tools/gyp/pylib/gyp/generator/gypd.py +++ b/tools/gyp/pylib/gyp/generator/gypd.py @@ -73,7 +73,7 @@ def GenerateOutput(target_list, target_dicts, data, params): output_files = {} for qualified_target in target_list: - [input_file, target] = gyp.common.ParseQualifiedTarget(qualified_target)[0:2] + [input_file, _target] = gyp.common.ParseQualifiedTarget(qualified_target)[0:2] if input_file[-4:] != ".gyp": continue diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py index 1f0995718b59b7..5f30f39fc503e5 100644 --- a/tools/gyp/pylib/gyp/generator/make.py +++ b/tools/gyp/pylib/gyp/generator/make.py @@ -1169,7 +1169,7 @@ def WriteRules( for rule_source in rule.get("rule_sources", []): dirs = set() (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = os.path.splitext( + (rule_source_root, _rule_source_ext) = os.path.splitext( rule_source_basename ) diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py index 3b258ee8f395e7..0f14c055049add 100644 --- a/tools/gyp/pylib/gyp/generator/msvs.py +++ b/tools/gyp/pylib/gyp/generator/msvs.py @@ -1666,7 +1666,7 @@ def _HandlePreCompiledHeaders(p, sources, spec): p.AddFileConfig( source, _ConfigFullName(config_name, config), {}, tools=[tool] ) - basename, extension = os.path.splitext(source) + _basename, extension = os.path.splitext(source) if extension == ".c": extensions_excluded_from_precompile = [".cc", ".cpp", ".cxx"] else: @@ -1677,7 +1677,7 @@ def DisableForSourceTree(source_tree): if isinstance(source, MSVSProject.Filter): DisableForSourceTree(source.contents) else: - basename, extension = os.path.splitext(source) + _basename, extension = os.path.splitext(source) if extension in extensions_excluded_from_precompile: for config_name, config in spec["configurations"].items(): tool = MSVSProject.Tool( @@ -3579,7 +3579,7 @@ def _AddSources2( # If the precompiled header is generated by a C source, # we must not try to use it for C++ sources, # and vice versa. - basename, extension = os.path.splitext(precompiled_source) + _basename, extension = os.path.splitext(precompiled_source) if extension == ".c": extensions_excluded_from_precompile = [ ".cc", diff --git a/tools/gyp/pylib/gyp/generator/xcode.py b/tools/gyp/pylib/gyp/generator/xcode.py index 8e05657961fe98..db4b45d1a04d25 100644 --- a/tools/gyp/pylib/gyp/generator/xcode.py +++ b/tools/gyp/pylib/gyp/generator/xcode.py @@ -531,7 +531,7 @@ def AddSourceToTarget(source, type, pbxp, xct): library_extensions = ["a", "dylib", "framework", "o"] basename = posixpath.basename(source) - (root, ext) = posixpath.splitext(basename) + (_root, ext) = posixpath.splitext(basename) if ext: ext = ext[1:].lower() @@ -696,7 +696,7 @@ def GenerateOutput(target_list, target_dicts, data, params): xcode_targets = {} xcode_target_to_target_dict = {} for qualified_target in target_list: - [build_file, target_name, toolset] = gyp.common.ParseQualifiedTarget( + [build_file, target_name, _toolset] = gyp.common.ParseQualifiedTarget( qualified_target ) @@ -1215,7 +1215,7 @@ def GenerateOutput(target_list, target_dicts, data, params): # Add "sources". for source in spec.get("sources", []): - (source_root, source_extension) = posixpath.splitext(source) + (_source_root, source_extension) = posixpath.splitext(source) if source_extension[1:] not in rules_by_ext: # AddSourceToTarget will add the file to a root group if it's not # already there. @@ -1227,7 +1227,7 @@ def GenerateOutput(target_list, target_dicts, data, params): # it's a bundle of any type. if is_bundle: for resource in tgt_mac_bundle_resources: - (resource_root, resource_extension) = posixpath.splitext(resource) + (_resource_root, resource_extension) = posixpath.splitext(resource) if resource_extension[1:] not in rules_by_ext: AddResourceToTarget(resource, pbxp, xct) else: diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py index 4965ff1571c73c..f3a5e168f2075d 100644 --- a/tools/gyp/pylib/gyp/input.py +++ b/tools/gyp/pylib/gyp/input.py @@ -2757,7 +2757,7 @@ def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): source_keys.extend(extra_sources_for_rules) for source_key in source_keys: for source in target_dict.get(source_key, []): - (source_root, source_extension) = os.path.splitext(source) + (_source_root, source_extension) = os.path.splitext(source) if source_extension.startswith("."): source_extension = source_extension[1:] if source_extension == rule_extension: diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py index 192a523529fddd..d13eaa9af240b7 100644 --- a/tools/gyp/pylib/gyp/xcode_emulation.py +++ b/tools/gyp/pylib/gyp/xcode_emulation.py @@ -1534,18 +1534,20 @@ def CLTVersion(): FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" - regex = re.compile("version: (?P.+)") + regex = re.compile(r"version: (?P.+)") for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: try: output = GetStdout(["/usr/sbin/pkgutil", "--pkg-info", key]) - return re.search(regex, output).groupdict()["version"] + if m := re.search(regex, output): + return m.groupdict()["version"] except (GypError, OSError): continue regex = re.compile(r"Command Line Tools for Xcode\s+(?P\S+)") try: output = GetStdout(["/usr/sbin/softwareupdate", "--history"]) - return re.search(regex, output).groupdict()["version"] + if m := re.search(regex, output): + return m.groupdict()["version"] except (GypError, OSError): return None diff --git a/tools/gyp/pylib/gyp/xcode_ninja.py b/tools/gyp/pylib/gyp/xcode_ninja.py index 1a97a06c51d9f5..a133fdbe8b4f58 100644 --- a/tools/gyp/pylib/gyp/xcode_ninja.py +++ b/tools/gyp/pylib/gyp/xcode_ninja.py @@ -22,7 +22,7 @@ def _WriteWorkspace(main_gyp, sources_gyp, params): """Create a workspace to wrap main and sources gyp paths.""" - (build_file_root, build_file_ext) = os.path.splitext(main_gyp) + (build_file_root, _build_file_ext) = os.path.splitext(main_gyp) workspace_path = build_file_root + ".xcworkspace" options = params["options"] if options.generator_output: diff --git a/tools/gyp/pylib/gyp/xcodeproj_file.py b/tools/gyp/pylib/gyp/xcodeproj_file.py index 11e2be07372230..cb467470d3044b 100644 --- a/tools/gyp/pylib/gyp/xcodeproj_file.py +++ b/tools/gyp/pylib/gyp/xcodeproj_file.py @@ -487,7 +487,7 @@ def Children(self): children = [] for property, attributes in self._schema.items(): - (is_list, property_type, is_strong) = attributes[0:3] + (is_list, _property_type, is_strong) = attributes[0:3] if is_strong and property in self._properties: if not is_list: children.append(self._properties[property]) @@ -913,7 +913,7 @@ def VerifyHasRequiredProperties(self): # TODO(mark): A stronger verification mechanism is needed. Some # subclasses need to perform validation beyond what the schema can enforce. for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] + (_is_list, _property_type, _is_strong, is_required) = attributes[0:4] if is_required and property not in self._properties: raise KeyError(self.__class__.__name__ + " requires " + property) @@ -923,7 +923,7 @@ def _SetDefaultsFromSchema(self): defaults = {} for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] + (_is_list, _property_type, _is_strong, is_required) = attributes[0:4] if ( is_required and len(attributes) >= 5 @@ -1616,7 +1616,7 @@ def __init__(self, properties=None, id=None, parent=None): prop_name = "lastKnownFileType" else: basename = posixpath.basename(self._properties["path"]) - (root, ext) = posixpath.splitext(basename) + (_root, ext) = posixpath.splitext(basename) # Check the map using a lowercase extension. # TODO(mark): Maybe it should try with the original case first and fall # back to lowercase, in case there are any instances where case @@ -2010,7 +2010,7 @@ def Name(self): return "Frameworks" def FileGroup(self, path): - (root, ext) = posixpath.splitext(path) + (_root, ext) = posixpath.splitext(path) if ext != "": ext = ext[1:].lower() if ext == "o": diff --git a/tools/gyp/pyproject.toml b/tools/gyp/pyproject.toml index 3a029c4fc5140c..adc82c3350151f 100644 --- a/tools/gyp/pyproject.toml +++ b/tools/gyp/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "gyp-next" -version = "0.20.4" +version = "0.20.5" authors = [ { name="Node.js contributors", email="ryzokuken@disroot.org" }, ] diff --git a/tools/gyp/tools/graphviz.py b/tools/gyp/tools/graphviz.py index ed1c7ab3cd10b5..65f78011b583c0 100755 --- a/tools/gyp/tools/graphviz.py +++ b/tools/gyp/tools/graphviz.py @@ -47,7 +47,7 @@ def WriteGraph(edges): # Bucket targets by file. files = collections.defaultdict(list) for src, dst in edges.items(): - build_file, target_name, toolset = ParseTarget(src) + build_file, target_name, _toolset = ParseTarget(src) files[build_file].append(src) print("digraph D {") @@ -62,14 +62,14 @@ def WriteGraph(edges): # If there's only one node for this file, simplify # the display by making it a box without an internal node. target = targets[0] - build_file, target_name, toolset = ParseTarget(target) + build_file, target_name, _toolset = ParseTarget(target) print(f' "{target}" [shape=box, label="{filename}\\n{target_name}"]') else: # Group multiple nodes together in a subgraph. print(' subgraph "cluster_%s" {' % filename) print(' label = "%s"' % filename) for target in targets: - build_file, target_name, toolset = ParseTarget(target) + build_file, target_name, _toolset = ParseTarget(target) print(f' "{target}" [label="{target_name}"]') print(" }")