Skip to content

Commit 5f0090a

Browse files
nodejs-github-botrichardlau
authored andcommitted
tools: update gyp-next to 0.20.4
PR-URL: #59690 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
1 parent a1d7e4f commit 5f0090a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2012
-2032
lines changed

tools/gyp/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [0.20.4](https://github.com/nodejs/gyp-next/compare/v0.20.3...v0.20.4) (2025-08-25)
4+
5+
6+
### Bug Fixes
7+
8+
* **cli:** remove duplicate usage ([#308](https://github.com/nodejs/gyp-next/issues/308)) ([0996f60](https://github.com/nodejs/gyp-next/commit/0996f60e9bc83ec9d7b31e39bebd23f8dc990130))
9+
* **docs:** Add running gyp via uv ([#306](https://github.com/nodejs/gyp-next/issues/306)) ([0e43f61](https://github.com/nodejs/gyp-next/commit/0e43f61da8154f9b460ccba9ce4c0a25d2383ac4))
10+
311
## [0.20.3](https://github.com/nodejs/gyp-next/compare/v0.20.2...v0.20.3) (2025-08-20)
412

513

tools/gyp/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Documents are available at [`./docs`](./docs).
66
__gyp-next__ is [released](https://github.com/nodejs/gyp-next/releases) to the [__Python Packaging Index__](https://pypi.org/project/gyp-next) (PyPI) and can be installed with the command:
77
* `python3 -m pip install gyp-next`
88

9-
When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
10-
* `pipx install gyp-next`
9+
When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx) or [uv](https://docs.astral.sh/uv):
10+
* `pipx install gyp-next ` # --or--
11+
* `uv tool install gyp-next`
1112
```
1213
Installing to a new venv 'gyp-next'
1314
installed package gyp-next 0.13.0, installed using Python 3.10.6
@@ -17,10 +18,11 @@ done! ✨ 🌟 ✨
1718
```
1819

1920
Or to run __gyp-next__ directly without installing it:
20-
* `pipx run gyp-next --help`
21+
* `pipx run gyp-next --help ` # --or--
22+
* `uvx --from=gyp-next gyp --help`
2123
```
2224
NOTE: running app 'gyp' from 'gyp-next'
23-
usage: usage: gyp [options ...] [build_file ...]
25+
usage: gyp [options ...] [build_file ...]
2426
2527
options:
2628
-h, --help show this help message and exit

tools/gyp/pylib/gyp/MSVSNew.py

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ def cmp(x, y):
3232
def MakeGuid(name, seed="msvs_new"):
3333
"""Returns a GUID for the specified target name.
3434
35-
Args:
36-
name: Target name.
37-
seed: Seed for MD5 hash.
38-
Returns:
39-
A GUID-line string calculated from the name and seed.
40-
41-
This generates something which looks like a GUID, but depends only on the
42-
name and seed. This means the same name/seed will always generate the same
43-
GUID, so that projects and solutions which refer to each other can explicitly
44-
determine the GUID to refer to explicitly. It also means that the GUID will
45-
not change when the project for a target is rebuilt.
46-
"""
35+
Args:
36+
name: Target name.
37+
seed: Seed for MD5 hash.
38+
Returns:
39+
A GUID-line string calculated from the name and seed.
40+
41+
This generates something which looks like a GUID, but depends only on the
42+
name and seed. This means the same name/seed will always generate the same
43+
GUID, so that projects and solutions which refer to each other can explicitly
44+
determine the GUID to refer to explicitly. It also means that the GUID will
45+
not change when the project for a target is rebuilt.
46+
"""
4747
# Calculate a MD5 signature for the seed and name.
4848
d = hashlib.md5((str(seed) + str(name)).encode("utf-8")).hexdigest().upper()
4949
# Convert most of the signature to GUID form (discard the rest)
@@ -78,15 +78,15 @@ class MSVSFolder(MSVSSolutionEntry):
7878
def __init__(self, path, name=None, entries=None, guid=None, items=None):
7979
"""Initializes the folder.
8080
81-
Args:
82-
path: Full path to the folder.
83-
name: Name of the folder.
84-
entries: List of folder entries to nest inside this folder. May contain
85-
Folder or Project objects. May be None, if the folder is empty.
86-
guid: GUID to use for folder, if not None.
87-
items: List of solution items to include in the folder project. May be
88-
None, if the folder does not directly contain items.
89-
"""
81+
Args:
82+
path: Full path to the folder.
83+
name: Name of the folder.
84+
entries: List of folder entries to nest inside this folder. May contain
85+
Folder or Project objects. May be None, if the folder is empty.
86+
guid: GUID to use for folder, if not None.
87+
items: List of solution items to include in the folder project. May be
88+
None, if the folder does not directly contain items.
89+
"""
9090
if name:
9191
self.name = name
9292
else:
@@ -128,19 +128,19 @@ def __init__(
128128
):
129129
"""Initializes the project.
130130
131-
Args:
132-
path: Absolute path to the project file.
133-
name: Name of project. If None, the name will be the same as the base
134-
name of the project file.
135-
dependencies: List of other Project objects this project is dependent
136-
upon, if not None.
137-
guid: GUID to use for project, if not None.
138-
spec: Dictionary specifying how to build this project.
139-
build_file: Filename of the .gyp file that the vcproj file comes from.
140-
config_platform_overrides: optional dict of configuration platforms to
141-
used in place of the default for this target.
142-
fixpath_prefix: the path used to adjust the behavior of _fixpath
143-
"""
131+
Args:
132+
path: Absolute path to the project file.
133+
name: Name of project. If None, the name will be the same as the base
134+
name of the project file.
135+
dependencies: List of other Project objects this project is dependent
136+
upon, if not None.
137+
guid: GUID to use for project, if not None.
138+
spec: Dictionary specifying how to build this project.
139+
build_file: Filename of the .gyp file that the vcproj file comes from.
140+
config_platform_overrides: optional dict of configuration platforms to
141+
used in place of the default for this target.
142+
fixpath_prefix: the path used to adjust the behavior of _fixpath
143+
"""
144144
self.path = path
145145
self.guid = guid
146146
self.spec = spec
@@ -195,16 +195,16 @@ def __init__(
195195
):
196196
"""Initializes the solution.
197197
198-
Args:
199-
path: Path to solution file.
200-
version: Format version to emit.
201-
entries: List of entries in solution. May contain Folder or Project
202-
objects. May be None, if the folder is empty.
203-
variants: List of build variant strings. If none, a default list will
204-
be used.
205-
websiteProperties: Flag to decide if the website properties section
206-
is generated.
207-
"""
198+
Args:
199+
path: Path to solution file.
200+
version: Format version to emit.
201+
entries: List of entries in solution. May contain Folder or Project
202+
objects. May be None, if the folder is empty.
203+
variants: List of build variant strings. If none, a default list will
204+
be used.
205+
websiteProperties: Flag to decide if the website properties section
206+
is generated.
207+
"""
208208
self.path = path
209209
self.websiteProperties = websiteProperties
210210
self.version = version
@@ -230,9 +230,9 @@ def __init__(
230230
def Write(self, writer=gyp.common.WriteOnDiff):
231231
"""Writes the solution file to disk.
232232
233-
Raises:
234-
IndexError: An entry appears multiple times.
235-
"""
233+
Raises:
234+
IndexError: An entry appears multiple times.
235+
"""
236236
# Walk the entry tree and collect all the folders and projects.
237237
all_entries = set()
238238
entries_to_check = self.entries[:]

tools/gyp/pylib/gyp/MSVSProject.py

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ class Tool:
1515
def __init__(self, name, attrs=None):
1616
"""Initializes the tool.
1717
18-
Args:
19-
name: Tool name.
20-
attrs: Dict of tool attributes; may be None.
21-
"""
18+
Args:
19+
name: Tool name.
20+
attrs: Dict of tool attributes; may be None.
21+
"""
2222
self._attrs = attrs or {}
2323
self._attrs["Name"] = name
2424

2525
def _GetSpecification(self):
2626
"""Creates an element for the tool.
2727
28-
Returns:
29-
A new xml.dom.Element for the tool.
30-
"""
28+
Returns:
29+
A new xml.dom.Element for the tool.
30+
"""
3131
return ["Tool", self._attrs]
3232

3333

@@ -37,10 +37,10 @@ class Filter:
3737
def __init__(self, name, contents=None):
3838
"""Initializes the folder.
3939
40-
Args:
41-
name: Filter (folder) name.
42-
contents: List of filenames and/or Filter objects contained.
43-
"""
40+
Args:
41+
name: Filter (folder) name.
42+
contents: List of filenames and/or Filter objects contained.
43+
"""
4444
self.name = name
4545
self.contents = list(contents or [])
4646

@@ -54,13 +54,13 @@ class Writer:
5454
def __init__(self, project_path, version, name, guid=None, platforms=None):
5555
"""Initializes the project.
5656
57-
Args:
58-
project_path: Path to the project file.
59-
version: Format version to emit.
60-
name: Name of the project.
61-
guid: GUID to use for project, if not None.
62-
platforms: Array of string, the supported platforms. If null, ['Win32']
63-
"""
57+
Args:
58+
project_path: Path to the project file.
59+
version: Format version to emit.
60+
name: Name of the project.
61+
guid: GUID to use for project, if not None.
62+
platforms: Array of string, the supported platforms. If null, ['Win32']
63+
"""
6464
self.project_path = project_path
6565
self.version = version
6666
self.name = name
@@ -84,21 +84,21 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
8484
def AddToolFile(self, path):
8585
"""Adds a tool file to the project.
8686
87-
Args:
88-
path: Relative path from project to tool file.
89-
"""
87+
Args:
88+
path: Relative path from project to tool file.
89+
"""
9090
self.tool_files_section.append(["ToolFile", {"RelativePath": path}])
9191

9292
def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools):
9393
"""Returns the specification for a configuration.
9494
95-
Args:
96-
config_type: Type of configuration node.
97-
config_name: Configuration name.
98-
attrs: Dict of configuration attributes; may be None.
99-
tools: List of tools (strings or Tool objects); may be None.
100-
Returns:
101-
"""
95+
Args:
96+
config_type: Type of configuration node.
97+
config_name: Configuration name.
98+
attrs: Dict of configuration attributes; may be None.
99+
tools: List of tools (strings or Tool objects); may be None.
100+
Returns:
101+
"""
102102
# Handle defaults
103103
if not attrs:
104104
attrs = {}
@@ -122,23 +122,23 @@ def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools):
122122
def AddConfig(self, name, attrs=None, tools=None):
123123
"""Adds a configuration to the project.
124124
125-
Args:
126-
name: Configuration name.
127-
attrs: Dict of configuration attributes; may be None.
128-
tools: List of tools (strings or Tool objects); may be None.
129-
"""
125+
Args:
126+
name: Configuration name.
127+
attrs: Dict of configuration attributes; may be None.
128+
tools: List of tools (strings or Tool objects); may be None.
129+
"""
130130
spec = self._GetSpecForConfiguration("Configuration", name, attrs, tools)
131131
self.configurations_section.append(spec)
132132

133133
def _AddFilesToNode(self, parent, files):
134134
"""Adds files and/or filters to the parent node.
135135
136-
Args:
137-
parent: Destination node
138-
files: A list of Filter objects and/or relative paths to files.
136+
Args:
137+
parent: Destination node
138+
files: A list of Filter objects and/or relative paths to files.
139139
140-
Will call itself recursively, if the files list contains Filter objects.
141-
"""
140+
Will call itself recursively, if the files list contains Filter objects.
141+
"""
142142
for f in files:
143143
if isinstance(f, Filter):
144144
node = ["Filter", {"Name": f.name}]
@@ -151,29 +151,29 @@ def _AddFilesToNode(self, parent, files):
151151
def AddFiles(self, files):
152152
"""Adds files to the project.
153153
154-
Args:
155-
files: A list of Filter objects and/or relative paths to files.
154+
Args:
155+
files: A list of Filter objects and/or relative paths to files.
156156
157-
This makes a copy of the file/filter tree at the time of this call. If you
158-
later add files to a Filter object which was passed into a previous call
159-
to AddFiles(), it will not be reflected in this project.
160-
"""
157+
This makes a copy of the file/filter tree at the time of this call. If you
158+
later add files to a Filter object which was passed into a previous call
159+
to AddFiles(), it will not be reflected in this project.
160+
"""
161161
self._AddFilesToNode(self.files_section, files)
162162
# TODO(rspangler) This also doesn't handle adding files to an existing
163163
# filter. That is, it doesn't merge the trees.
164164

165165
def AddFileConfig(self, path, config, attrs=None, tools=None):
166166
"""Adds a configuration to a file.
167167
168-
Args:
169-
path: Relative path to the file.
170-
config: Name of configuration to add.
171-
attrs: Dict of configuration attributes; may be None.
172-
tools: List of tools (strings or Tool objects); may be None.
168+
Args:
169+
path: Relative path to the file.
170+
config: Name of configuration to add.
171+
attrs: Dict of configuration attributes; may be None.
172+
tools: List of tools (strings or Tool objects); may be None.
173173
174-
Raises:
175-
ValueError: Relative path does not match any file added via AddFiles().
176-
"""
174+
Raises:
175+
ValueError: Relative path does not match any file added via AddFiles().
176+
"""
177177
# Find the file node with the right relative path
178178
parent = self.files_dict.get(path)
179179
if not parent:

0 commit comments

Comments
 (0)