diff --git a/tools/gyp/CHANGELOG.md b/tools/gyp/CHANGELOG.md index 89a41685244770..c7ddd862d1a4a0 100644 --- a/tools/gyp/CHANGELOG.md +++ b/tools/gyp/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.22.1](https://github.com/nodejs/gyp-next/compare/v0.22.0...v0.22.1) (2026-04-21) + + +### Bug Fixes + +* use floor division when escaping command-line arguments ([#338](https://github.com/nodejs/gyp-next/issues/338)) ([cadca24](https://github.com/nodejs/gyp-next/commit/cadca2416dc13e117e035ad6dd2b471a86d0430f)) + ## [0.22.0](https://github.com/nodejs/gyp-next/compare/v0.21.1...v0.22.0) (2026-04-02) diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py index 0f14c055049add..42bee33d9b63d8 100644 --- a/tools/gyp/pylib/gyp/generator/msvs.py +++ b/tools/gyp/pylib/gyp/generator/msvs.py @@ -857,7 +857,7 @@ def _EscapeCommandLineArgumentForMSBuild(s): """Escapes a Windows command-line argument for use by MSBuild.""" def _Replace(match): - return (len(match.group(1)) / 2 * 4) * "\\" + '\\"' + return (len(match.group(1)) // 2 * 4) * "\\" + '\\"' # Escape all quotes so that they are interpreted literally. s = quote_replacer_regex2.sub(_Replace, s) diff --git a/tools/gyp/pylib/gyp/generator/ninja_test.py b/tools/gyp/pylib/gyp/generator/ninja_test.py index 5b688ae7d1207b..8b590af8eb3861 100644 --- a/tools/gyp/pylib/gyp/generator/ninja_test.py +++ b/tools/gyp/pylib/gyp/generator/ninja_test.py @@ -39,7 +39,7 @@ def test_BinaryNamesWindows(self): "executable": ".exe", "shared_library": ".dll", "static_library": ".lib", - }: + }.items(): self.assertTrue(writer.ComputeOutputFileName(spec, key).endswith(ext)) def test_BinaryNamesLinux(self): diff --git a/tools/gyp/pylib/gyp/simple_copy.py b/tools/gyp/pylib/gyp/simple_copy.py index 8b026642fc5ef0..2b9100f3e1ba80 100644 --- a/tools/gyp/pylib/gyp/simple_copy.py +++ b/tools/gyp/pylib/gyp/simple_copy.py @@ -24,8 +24,8 @@ def deepcopy(x): return _deepcopy_dispatch[type(x)](x) except KeyError: raise Error( - "Unsupported type %s for deepcopy. Use copy.deepcopy " - + "or expand simple_copy support." % type(x) + f"Unsupported type {type(x)} for deepcopy. Use copy.deepcopy " + + "or expand simple_copy support." ) diff --git a/tools/gyp/pylib/packaging/metadata.py b/tools/gyp/pylib/packaging/metadata.py index 43f5c5b30df979..38fa645b4c950b 100644 --- a/tools/gyp/pylib/packaging/metadata.py +++ b/tools/gyp/pylib/packaging/metadata.py @@ -21,27 +21,10 @@ from . import requirements, specifiers, utils, version as version_module T = typing.TypeVar("T") -if sys.version_info[:2] >= (3, 8): # pragma: no cover - from typing import Literal, TypedDict -else: # pragma: no cover - if typing.TYPE_CHECKING: - from typing_extensions import Literal, TypedDict - else: - try: - from typing_extensions import Literal, TypedDict - except ImportError: - - class Literal: - def __init_subclass__(*_args, **_kwargs): - pass - - class TypedDict: - def __init_subclass__(*_args, **_kwargs): - pass - +from typing import Literal, TypedDict try: - ExceptionGroup + ExceptionGroup # Added in Python 3.11+ except NameError: # pragma: no cover class ExceptionGroup(Exception): # noqa: N818 @@ -504,7 +487,7 @@ def __set_name__(self, _owner: "Metadata", name: str) -> None: self.raw_name = _RAW_TO_EMAIL_MAPPING[name] def __get__(self, instance: "Metadata", _owner: Type["Metadata"]) -> T: - # With Python 3.8, the caching can be replaced with functools.cached_property(). + # With Python 3.8+, the caching can be replaced with functools.cached_property(). # No need to check the cache as attribute lookup will resolve into the # instance's __dict__ before __get__ is called. cache = instance.__dict__ diff --git a/tools/gyp/pylib/packaging/tags.py b/tools/gyp/pylib/packaging/tags.py index 37f33b1ef849ed..f1da2b96d39c1c 100644 --- a/tools/gyp/pylib/packaging/tags.py +++ b/tools/gyp/pylib/packaging/tags.py @@ -127,10 +127,8 @@ def _normalize_string(string: str) -> str: def _abi3_applies(python_version: PythonVersion) -> bool: """ Determine if the Python version supports abi3. - - PEP 384 was first implemented in Python 3.2. """ - return len(python_version) > 1 and tuple(python_version) >= (3, 2) + return len(python_version) > 1 def _cpython_abis(py_version: PythonVersion, warn: bool = False) -> List[str]: @@ -146,17 +144,7 @@ def _cpython_abis(py_version: PythonVersion, warn: bool = False) -> List[str]: has_ext = "_d.pyd" in EXTENSION_SUFFIXES if with_debug or (with_debug is None and (has_refcount or has_ext)): debug = "d" - if py_version < (3, 8): - with_pymalloc = _get_config_var("WITH_PYMALLOC", warn) - if with_pymalloc or with_pymalloc is None: - pymalloc = "m" - if py_version < (3, 3): - unicode_size = _get_config_var("Py_UNICODE_SIZE", warn) - if unicode_size == 4 or ( - unicode_size is None and sys.maxunicode == 0x10FFFF - ): - ucs4 = "u" - elif debug: + if debug: # Debug builds can also load "normal" extension modules. # We can also assume no UCS-4 or pymalloc requirement. abis.append(f"cp{version}") diff --git a/tools/gyp/pyproject.toml b/tools/gyp/pyproject.toml index 591ed4f5b0b6cc..239bef7844a659 100644 --- a/tools/gyp/pyproject.toml +++ b/tools/gyp/pyproject.toml @@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta" [project] name = "gyp-next" -version = "0.22.0" +version = "0.22.1" authors = [ { name="Node.js contributors", email="ryzokuken@disroot.org" }, ] description = "A fork of the GYP build system for use in the Node.js projects" readme = "README.md" license = { file="LICENSE" } -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = ["packaging>=24.0", "setuptools>=69.5.1"] classifiers = [ "Development Status :: 3 - Alpha", @@ -21,10 +21,12 @@ classifiers = [ "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] [project.optional-dependencies]