Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pylib/gyp/MSVSVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def _RegistryGetValueUsingWinReg(key, value):
contents of the registry key's value, or None on failure. Throws
ImportError if winreg is unavailable.
"""
from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx
from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx # noqa: PLC0415
try:
root, subkey = key.split("\\", 1)
assert root == "HKLM" # Only need HKLM for now.
Expand Down
2 changes: 1 addition & 1 deletion pylib/gyp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def gyp_main(args):

options, build_files_arg = parser.parse_args(args)
if options.version:
import pkg_resources
import pkg_resources # noqa: PLC0415
print(f"v{pkg_resources.get_distribution('gyp-next').version}")
return 0
build_files = build_files_arg
Expand Down
3 changes: 2 additions & 1 deletion pylib/gyp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ def uniquer(seq, idfun=lambda x: x):


# Based on http://code.activestate.com/recipes/576694/.
class OrderedSet(MutableSet):
class OrderedSet(MutableSet): # noqa: PLW1641
# TODO (cclauss): Fix eq-without-hash ruff rule PLW1641
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end] # sentinel node for doubly linked list
Expand Down
2 changes: 1 addition & 1 deletion pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def CalculateVariables(default_variables, params):

# Copy additional generator configuration data from Xcode, which is shared
# by the Mac Make generator.
import gyp.generator.xcode as xcode_generator
import gyp.generator.xcode as xcode_generator # noqa: PLC0415

global generator_additional_non_configuration_keys
generator_additional_non_configuration_keys = getattr(
Expand Down
7 changes: 3 additions & 4 deletions pylib/gyp/generator/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import collections
import copy
import ctypes
import hashlib
import json
import multiprocessing
Expand Down Expand Up @@ -1993,7 +1994,7 @@ def CalculateVariables(default_variables, params):

# Copy additional generator configuration data from Xcode, which is shared
# by the Mac Ninja generator.
import gyp.generator.xcode as xcode_generator
import gyp.generator.xcode as xcode_generator # noqa: PLC0415

generator_additional_non_configuration_keys = getattr(
xcode_generator, "generator_additional_non_configuration_keys", []
Expand All @@ -2016,7 +2017,7 @@ def CalculateVariables(default_variables, params):

# Copy additional generator configuration data from VS, which is shared
# by the Windows Ninja generator.
import gyp.generator.msvs as msvs_generator
import gyp.generator.msvs as msvs_generator # noqa: PLC0415

generator_additional_non_configuration_keys = getattr(
msvs_generator, "generator_additional_non_configuration_keys", []
Expand Down Expand Up @@ -2084,8 +2085,6 @@ def GetDefaultConcurrentLinks():
return pool_size

if sys.platform in ("win32", "cygwin"):
import ctypes

class MEMORYSTATUSEX(ctypes.Structure):
_fields_ = [
("dwLength", ctypes.c_ulong),
Expand Down
2 changes: 1 addition & 1 deletion pylib/gyp/mac_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _CopyStringsFile(self, source, dest):
# CFPropertyListCreateFromXMLData(): Old-style plist parser: missing
# semicolon in dictionary.
# on invalid files. Do the same kind of validation.
import CoreFoundation
import CoreFoundation # noqa: PLC0415

with open(source, "rb") as in_file:
s = in_file.read()
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ gyp = "gyp:script_main"
[tool.ruff]
extend-exclude = ["pylib/packaging"]
line-length = 88
target-version = "py37"

[tool.ruff.lint]
select = [
Expand Down
4 changes: 2 additions & 2 deletions test_gyp.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ def print_configuration_info():
print("Test configuration:")
if sys.platform == "darwin":
sys.path.append(os.path.abspath("test/lib"))
import TestMac
import TestMac # noqa: PLC0415

print(f" Mac {platform.mac_ver()[0]} {platform.mac_ver()[2]}")
print(f" Xcode {TestMac.Xcode.Version()}")
elif sys.platform == "win32":
sys.path.append(os.path.abspath("pylib"))
import gyp.MSVSVersion
import gyp.MSVSVersion # noqa: PLC0415

print(" Win %s %s\n" % platform.win32_ver()[0:2])
print(" MSVS %s" % gyp.MSVSVersion.SelectVisualStudioVersion().Description())
Expand Down
Loading