Skip to content

Commit 707927c

Browse files
DeeDeeGrzhao271cclauss
authored
feat(gyp): update gyp to v0.16.1 (#2923)
* feat(gyp): update gyp to v0.15.1 * Add Python 3.12 to tests * Try to fix CI * Try specifying msvs-version * Modify the visual-studio matrix * Fix pythonLocation var * Fix Python tests * Get path * polish * feat(gyp): update gyp to v0.16.0 * feat(gyp): update gyp to v0.16.1 * CI: Don't install Python 'packaging' module (vendored in 'gyp-next' now) * Apply suggestions from code review * Upgrade to actions/checkout@v4 --------- Co-authored-by: Raymond Zhao <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
1 parent d644ce4 commit 707927c

Some content is hidden

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

51 files changed

+5122
-247
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
max-parallel: 15
2626
matrix:
2727
node: [16.x, 18.x, 20.x]
28-
python: ["3.8", "3.11"]
28+
python: ["3.8", "3.10", "3.12"]
2929
os: [macos-latest, ubuntu-latest, windows-latest]
3030
runs-on: ${{ matrix.os }}
3131
steps:
@@ -56,5 +56,11 @@ jobs:
5656
# run: python -m pytest --doctest-modules
5757
- name: Environment Information
5858
run: npx envinfo
59-
- name: Run Node tests
60-
run: npm test
59+
- name: Run Node tests (macOS or Linux)
60+
if: runner.os != 'Windows'
61+
shell: bash
62+
run: npm test --python="${pythonLocation}/python"
63+
- name: Run tests (Windows)
64+
if: runner.os == 'Windows'
65+
shell: pwsh
66+
run: npm run test --python="${env:pythonLocation}\\python.exe"

.github/workflows/visual-studio.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ jobs:
1616
fail-fast: false
1717
max-parallel: 8
1818
matrix:
19-
os: [windows-latest]
20-
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
19+
include:
20+
- os: windows-2019
21+
msvs-verison: 2019
22+
- os: windows-2022
23+
msvs-version: 2022
2124
runs-on: ${{ matrix.os }}
2225
steps:
2326
- name: Checkout Repository
24-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
2528
- name: Install Dependencies
2629
run: |
2730
npm install --no-progress
28-
# npm audit fix --force
29-
- name: Set Windows environment
30-
if: startsWith(matrix.os, 'windows')
31-
run: |
32-
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
33-
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
3431
- name: Environment Information
3532
run: npx envinfo
3633
- name: Run Node tests
37-
run: npm test
34+
shell: pwsh
35+
run: |
36+
$pythonLocation = (Get-Command python).Source
37+
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"

gyp/.flake8

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

gyp/.github/workflows/Python_tests.yml

Lines changed: 7 additions & 6 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:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
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 --output-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: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,33 @@ 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.10", "3.12"]
1515

1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Clone gyp-next
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
path: gyp-next
2222
- name: Clone nodejs/node-gyp
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
repository: nodejs/node-gyp
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/.github/workflows/nodejs-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ on:
99

1010
jobs:
1111
build-windows:
12-
runs-on: windows-2019
12+
runs-on: windows-latest
1313
steps:
1414
- name: Clone gyp-next
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
1717
path: gyp-next
1818
- name: Clone nodejs/node
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
repository: nodejs/node
2222
path: node

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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# Changelog
22

3+
## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)
4+
5+
6+
### Bug Fixes
7+
8+
* add quotes for command in msvs generator ([#217](https://github.com/nodejs/gyp-next/issues/217)) ([d3b7bcd](https://github.com/nodejs/gyp-next/commit/d3b7bcdec90d6c1b1affc15ece706e63007b7264))
9+
10+
## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)
11+
12+
13+
### Features
14+
15+
* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))
16+
17+
## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)
18+
19+
20+
### Bug Fixes
21+
22+
* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
23+
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))
24+
25+
## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)
26+
27+
28+
### Features
29+
30+
* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))
31+
32+
## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)
33+
34+
35+
### Bug Fixes
36+
37+
* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
38+
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))
39+
40+
41+
### Documentation
42+
43+
* 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))
44+
345
## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)
446

547

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):

0 commit comments

Comments
 (0)