Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
feat(gyp): update gyp to v0.16.1 by rzhao271 · Pull Request #2909 · nodejs/node-gyp · GitHub
Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(gyp): update gyp to v0.16.1 by rzhao271 · Pull Request #2909 · nodejs/node-gyp · GitHub
Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(gyp): update gyp to v0.16.1 by rzhao271 · Pull Request #2909 · nodejs/node-gyp · GitHub
Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' feat(gyp): update gyp to v0.16.1 by rzhao271 · Pull Request #2909 · nodejs/node-gyp · GitHub
Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(gyp): update gyp to v0.16.1 by rzhao271 · Pull Request #2909 · nodejs/node-gyp · GitHub
Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(gyp): update gyp to v0.16.1 by rzhao271 · Pull Request #2909 · nodejs/node-gyp · GitHub
Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); feat(gyp): update gyp to v0.16.1 by rzhao271 · Pull Request #2909 · nodejs/node-gyp · GitHub
Skip to content
Closed
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
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ jobs:
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand DownExpand Up@@ -52,5 +52,11 @@ jobs:
# run: python -m pytest --doctest-modules
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
- name: Run Node tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
18 changes: 9 additions & 9 deletions .github/workflows/visual-studio.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,22 +12,22 @@ jobs:
fail-fast: false
max-parallel: 8
matrix:
os: [windows-latest]
msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win
include:
- os: windows-2019
msvs-verison: 2019
- os: windows-2022
msvs-version: 2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm install --no-progress
# npm audit fix --force
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Environment Information
run: npx envinfo
- name: Run Node tests
run: npm test
shell: pwsh
run: |
$pythonLocation = (Get-Command python).Source
npm run test --python="${pythonLocation}" --msvs-version="${{ matrix.msvs-version }}"
4 changes: 0 additions & 4 deletions gyp/.flake8

This file was deleted.

13 changes: 7 additions & 6 deletions gyp/.github/workflows/Python_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,24 +13,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
29 changes: 22 additions & 7 deletions gyp/.github/workflows/node-gyp.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,26 +11,33 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.7", "3.10"]
python: ["3.8", "3.10", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
Expand All@@ -39,7 +46,15 @@ jobs:
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm test
npm run test --python="${env:pythonLocation}\\python.exe"
6 changes: 3 additions & 3 deletions gyp/.github/workflows/nodejs-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,14 +9,14 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
Expand Down
1 change: 1 addition & 0 deletions gyp/AUTHORS
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,3 +14,4 @@ Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Ujjwal Sharma <ryzokuken@disroot.org>
Christian Clauss <cclauss@me.com>
42 changes: 42 additions & 0 deletions gyp/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
# Changelog

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


### Bug Fixes

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

## [0.16.0](https://github.com/nodejs/gyp-next/compare/v0.15.1...v0.16.0) (2023-10-23)


### Features

* add VCToolsVersion for msvs ([#209](https://github.com/nodejs/gyp-next/issues/209)) ([0e35ab8](https://github.com/nodejs/gyp-next/commit/0e35ab812d890fb75cf89a19ea72bc93dd6ba186))

## [0.15.1](https://github.com/nodejs/gyp-next/compare/v0.15.0...v0.15.1) (2023-09-08)


### Bug Fixes

* some Python lint issues ([#200](https://github.com/nodejs/gyp-next/issues/200)) ([d2dfe4e](https://github.com/nodejs/gyp-next/commit/d2dfe4e66b64c16b38bef984782db93d12674f05))
* use generator_output as output_dir ([#191](https://github.com/nodejs/gyp-next/issues/191)) ([35ffeb1](https://github.com/nodejs/gyp-next/commit/35ffeb1da8ef3fc8311e2e812cff550568f7e8a2))

## [0.15.0](https://github.com/nodejs/gyp-next/compare/v0.14.1...v0.15.0) (2023-03-30)


### Features

* **msvs:** add SpectreMitigation attribute ([#190](https://github.com/nodejs/gyp-next/issues/190)) ([853e464](https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991))

## [0.14.1](https://github.com/nodejs/gyp-next/compare/v0.14.0...v0.14.1) (2023-02-19)


### Bug Fixes

* flake8 extended-ignore ([#186](https://github.com/nodejs/gyp-next/issues/186)) ([c38493c](https://github.com/nodejs/gyp-next/commit/c38493c2556aa63b6dc40ab585c18aef5ca270d3))
* No build_type in default_variables ([#183](https://github.com/nodejs/gyp-next/issues/183)) ([ac262fe](https://github.com/nodejs/gyp-next/commit/ac262fe82453c4e8dc47529338d157eb0b5ec0fb))


### Documentation

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

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


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

__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:
* `python3 -m pip install gyp-next`

When used as a command line utility, __gyp-next__ can also be installed with [pipx](https://pypa.github.io/pipx):
* `pipx install gyp-next`
```
Installing to a new venv 'gyp-next'
installed package gyp-next 0.13.0, installed using Python 3.10.6
These apps are now globally available
- gyp
done! ✨ 🌟 ✨
```

Or to run __gyp-next__ directly without installing it:
* `pipx run gyp-next --help`
```
NOTE: running app 'gyp' from 'gyp-next'
usage: usage: gyp [options ...] [build_file ...]

options:
-h, --help show this help message and exit
--build CONFIGS configuration for build after project generation
--check check format of gyp files
[ ... ]
```
26 changes: 12 additions & 14 deletions gyp/pylib/gyp/MSVSNew.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,19 +285,17 @@ def Write(self, writer=gyp.common.WriteOnDiff):
"\tEndProjectSection\r\n"
)

if isinstance(e, MSVSFolder):
if e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject):
if e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")
if isinstance(e, MSVSFolder) and e.items:
f.write("\tProjectSection(SolutionItems) = preProject\r\n")
for i in e.items:
f.write(f"\t\t{i} = {i}\r\n")
f.write("\tEndProjectSection\r\n")

if isinstance(e, MSVSProject) and e.dependencies:
f.write("\tProjectSection(ProjectDependencies) = postProject\r\n")
for d in e.dependencies:
f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n")
f.write("\tEndProjectSection\r\n")

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

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

# Folder mappings
# Omit this section if there are no folders
if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]):
if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)):
f.write("\tGlobalSection(NestedProjects) = preSolution\r\n")
for e in all_entries:
if not isinstance(e, MSVSFolder):
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSProject.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ def __init__(self, project_path, version, name, guid=None, platforms=None):
self.files_section = ["Files"]

# Keep a dict keyed on filename to speed up access.
self.files_dict = dict()
self.files_dict = {}

def AddToolFile(self, path):
"""Adds a tool file to the project.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/MSVSSettings.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ class _Boolean(_Type):
"""Boolean settings, can have the values 'false' or 'true'."""

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

def ValidateMSVS(self, value):
Expand Down
6 changes: 4 additions & 2 deletions gyp/pylib/gyp/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,7 +108,9 @@ def Load(
if default_variables["GENERATOR"] == "ninja":
default_variables.setdefault(
"PRODUCT_DIR_ABS",
os.path.join(output_dir, "out", default_variables["build_type"]),
os.path.join(
output_dir, "out", default_variables.get("build_type", "default")
),
)
else:
default_variables.setdefault(
Expand DownExpand Up@@ -622,7 +624,7 @@ def gyp_main(args):
if options.generator_flags:
gen_flags += options.generator_flags
generator_flags = NameValueListToDict(gen_flags)
if DEBUG_GENERAL in gyp.debug.keys():
if DEBUG_GENERAL in gyp.debug:
DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)

# Generate all requested formats (use a set in case we got one format request
Expand Down
21 changes: 7 additions & 14 deletions gyp/pylib/gyp/common.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,20 +144,16 @@ def RelativePath(path, relative_to, follow_path_symlink=True):
# symlink, this option has no effect.

# Convert to normalized (and therefore absolute paths).
if follow_path_symlink:
path = os.path.realpath(path)
else:
path = os.path.abspath(path)
path = os.path.realpath(path) if follow_path_symlink else os.path.abspath(path)
relative_to = os.path.realpath(relative_to)

# On Windows, we can't create a relative path to a different drive, so just
# use the absolute path.
if sys.platform == "win32":
if (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path
if sys.platform == "win32" and (
os.path.splitdrive(path)[0].lower()
!= os.path.splitdrive(relative_to)[0].lower()
):
return path

# Split the paths into components.
path_split = path.split(os.path.sep)
Expand DownExpand Up@@ -277,10 +273,7 @@ def EncodePOSIXShellArgument(argument):
if not isinstance(argument, str):
argument = str(argument)

if _quote.search(argument):
quote = '"'
else:
quote = ""
quote = '"' if _quote.search(argument) else ""

encoded = quote + re.sub(_escape, r"\\\1", argument) + quote

Expand Down
6 changes: 5 additions & 1 deletion gyp/pylib/gyp/easy_xml.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False,
if win32 and os.linesep != "\r\n":
xml_string = xml_string.replace("\n", "\r\n")

default_encoding = locale.getdefaultlocale()[1]
try: # getdefaultlocale() was removed in Python 3.11
default_encoding = locale.getdefaultlocale()[1]
except AttributeError:
default_encoding = locale.getencoding()

if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.encode(encoding)

Expand Down
4 changes: 4 additions & 0 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,6 +76,8 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
"<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"<VCToolsVersion>14.36.32532</VCToolsVersion>"
"</PropertyGroup>"
"</Project>"
)
Expand All@@ -99,6 +101,8 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
["SpectreMitigation", "SpectreLoadCF"],
["VCToolsVersion", "14.36.32532"],
],
]
)
Expand Down
Loading