Skip to content

Commit 8afb80d

Browse files
committed
feat(gyp): update gyp to v0.15.1
1 parent b3d41ae commit 8afb80d

30 files changed

+313
-228
lines changed

gyp/.flake8

Lines changed: 0 additions & 4 deletions
This file was deleted.

gyp/.github/workflows/Python_tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,25 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
fail-fast: false
16-
max-parallel: 8
16+
max-parallel: 5
1717
matrix:
1818
os: [macos-latest, ubuntu-latest] # , windows-latest]
19-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
19+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
2020
steps:
2121
- uses: actions/checkout@v3
2222
- name: Set up Python ${{ matrix.python-version }}
2323
uses: actions/setup-python@v4
2424
with:
2525
python-version: ${{ matrix.python-version }}
26+
allow-prereleases: true
2627
- name: Install dependencies
2728
run: |
2829
python -m pip install --upgrade pip setuptools
2930
pip install --editable ".[dev]"
3031
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
31-
- name: Lint with flake8
32-
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
33-
- name: Test with pytest
32+
- name: Lint with ruff # See pyproject.toml for settings
33+
run: ruff --format=github .
34+
- name: Test with pytest # See pyproject.toml for settings
3435
run: pytest
3536
# - name: Run doctests with pytest
3637
# run: pytest --doctest-modules

gyp/.github/workflows/node-gyp.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
os: [macos-latest, ubuntu-latest, windows-latest]
14-
python: ["3.7", "3.10"]
14+
python: ["3.8", "3.x", "3.12"]
1515

1616
runs-on: ${{ matrix.os }}
1717
steps:
@@ -26,11 +26,18 @@ jobs:
2626
path: node-gyp
2727
- uses: actions/setup-node@v3
2828
with:
29-
node-version: 14.x
29+
node-version: 18.x
3030
- uses: actions/setup-python@v4
3131
with:
3232
python-version: ${{ matrix.python }}
33-
- name: Install dependencies
33+
allow-prereleases: true
34+
- name: Install Python dependencies
35+
run: |
36+
cd gyp-next
37+
python -m pip install --upgrade pip setuptools
38+
pip install --editable .
39+
pip uninstall -y gyp-next
40+
- name: Install Node.js dependencies
3441
run: |
3542
cd node-gyp
3643
npm install --no-progress
@@ -39,7 +46,15 @@ jobs:
3946
run: |
4047
rm -rf node-gyp/gyp
4148
cp -r gyp-next node-gyp/gyp
42-
- name: Run tests
49+
- name: Run tests (macOS or Linux)
50+
if: runner.os != 'Windows'
51+
shell: bash
52+
run: |
53+
cd node-gyp
54+
npm test --python="${pythonLocation}/python"
55+
- name: Run tests (Windows)
56+
if: runner.os == 'Windows'
57+
shell: pwsh
4358
run: |
4459
cd node-gyp
45-
npm test
60+
npm run test --python="${env:pythonLocation}\\python.exe"

gyp/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Tom Freudenberg <[email protected]>
1414
Julien Brianceau <[email protected]>
1515
Refael Ackermann <[email protected]>
1616
Ujjwal Sharma <[email protected]>
17+
Christian Clauss <[email protected]>

gyp/CHANGELOG.md

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

3+
## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)
4+
5+
6+
### Bug Fixes
7+
8+
* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
9+
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))
10+
11+
## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)
12+
13+
14+
### Features
15+
16+
* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))
17+
18+
## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)
19+
20+
21+
### Bug Fixes
22+
23+
* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
24+
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))
25+
26+
27+
### Documentation
28+
29+
* README.md: Add pipx installation and run instructions ([#165](https://github.com/nodejs/gyp-next/issues/165)) ([4d28b15](https://github.com/nodejs/gyp-next/commit/4d28b155568dc35f11c7f86124d1dd42ba428bed))
30+
331
## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)
432

533

gyp/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,26 @@ Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check
55

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`
8+
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`
11+
```
12+
Installing to a new venv 'gyp-next'
13+
installed package gyp-next 0.13.0, installed using Python 3.10.6
14+
These apps are now globally available
15+
- gyp
16+
done! ✨ 🌟 ✨
17+
```
18+
19+
Or to run __gyp-next__ directly without installing it:
20+
* `pipx run gyp-next --help`
21+
```
22+
NOTE: running app 'gyp' from 'gyp-next'
23+
usage: usage: gyp [options ...] [build_file ...]
24+
25+
options:
26+
-h, --help show this help message and exit
27+
--build CONFIGS configuration for build after project generation
28+
--check check format of gyp files
29+
[ ... ]
30+
```

gyp/pylib/gyp/MSVSNew.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
285285
"\tEndProjectSection\r\n"
286286
)
287287

288-
if isinstance(e, MSVSFolder):
289-
if e.items:
290-
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
291-
for i in e.items:
292-
f.write(f"\t\t{i} = {i}\r\n")
293-
f.write("\tEndProjectSection\r\n")
294-
295-
if isinstance(e, MSVSProject):
296-
if e.dependencies:
297-
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
298-
for d in e.dependencies:
299-
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
300-
f.write("\tEndProjectSection\r\n")
288+
if isinstance(e, MSVSFolder) and e.items:
289+
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
290+
for i in e.items:
291+
f.write(f"\t\t{i} = {i}\r\n")
292+
f.write("\tEndProjectSection\r\n")
293+
294+
if isinstance(e, MSVSProject) and e.dependencies:
295+
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
296+
for d in e.dependencies:
297+
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
298+
f.write("\tEndProjectSection\r\n")
301299

302300
f.write("EndProject\r\n")
303301

@@ -353,7 +351,7 @@ def Write(self, writer=gyp.common.WriteOnDiff):
353351

354352
# Folder mappings
355353
# Omit this section if there are no folders
356-
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
354+
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
357355
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
358356
for e in all_entries:
359357
if not isinstance(e, MSVSFolder):

gyp/pylib/gyp/MSVSProject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
7979
self.files_section = ["Files"]
8080

8181
# Keep a dict keyed on filename to speed up access.
82-
self.files_dict = dict()
82+
self.files_dict = {}
8383

8484
def AddToolFile(self, path):
8585
"""Adds a tool file to the project.

gyp/pylib/gyp/MSVSSettings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class _Boolean(_Type):
141141
"""Boolean settings, can have the values 'false' or 'true'."""
142142

143143
def _Validate(self, value):
144-
if value != "true" and value != "false":
144+
if value not in {"true", "false"}:
145145
raise ValueError("expected bool; got %r" % value)
146146

147147
def ValidateMSVS(self, value):

gyp/pylib/gyp/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def Load(
108108
if default_variables["GENERATOR"] == "ninja":
109109
default_variables.setdefault(
110110
"PRODUCT_DIR_ABS",
111-
os.path.join(output_dir, "out", default_variables["build_type"]),
111+
os.path.join(
112+
output_dir, "out", default_variables.get("build_type", "default")
113+
),
112114
)
113115
else:
114116
default_variables.setdefault(
@@ -622,7 +624,7 @@ def gyp_main(args):
622624
if options.generator_flags:
623625
gen_flags += options.generator_flags
624626
generator_flags = NameValueListToDict(gen_flags)
625-
if DEBUG_GENERAL in gyp.debug.keys():
627+
if DEBUG_GENERAL in gyp.debug:
626628
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)
627629

628630
# Generate all requested formats (use a set in case we got one format request

0 commit comments

Comments
 (0)