Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ max_line_length = 88 # Same as Ruff's default
[*.md]
trim_trailing_whitespace = false

[*.{yaml,yml,json,toml,clang-format}]
[*.{yaml,yml,json,toml,clang-format,vcxproj}]
indent_size = 2
44 changes: 44 additions & 0 deletions .github/workflows/install-vs-components.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://github.com/actions/runner-images/issues/9701
# Adapted from https://github.com/actions/runner-images/issues/9873#issuecomment-2139288682

import os
import platform
from itertools import chain
from subprocess import check_call, check_output

os.chdir("C:/Program Files (x86)/Microsoft Visual Studio/Installer")
vs_install_path = check_output(
(
"vswhere.exe",
"-latest",
"-products",
"*",
"-requires",
"Microsoft.Component.MSBuild",
"-property",
"installationPath",
),
text=True,
shell=True,
).strip()
components_to_add = (
["Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64"]
if platform.machine() == "ARM64"
else ["Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL"]
)
args = (
"vs_installer.exe",
"modify",
"--installPath",
vs_install_path,
*chain.from_iterable([("--add", component) for component in components_to_add]),
"--quiet",
"--norestart",
)
print(*args)

# Should be run twice for some reason
print("First run...")
check_call(args)
print("Second run...")
check_call(args)
34 changes: 18 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ env:
jobs:
test:
name: Build and test
runs-on: windows-2019
timeout-minutes: 20
runs-on: windows-2022
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
architecture: ["x64", "x86"]
architecture: [x64, x86]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -63,14 +63,16 @@ jobs:
pywin32_postinstall -remove -destination "$UserSite"

# Compilation and registration of the PyCOMTest server dll
- name: Set up MSVC
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Install missing Visual Studio components
run: python .github\workflows\install-vs-components.py

- name: Build and register the PyCOMTest server dll
run: |
cd com/TestSources/PyCOMTest
msbuild .\PyCOMTest.sln -property:Configuration=Release
cd x64/Release
regsvr32 .\PyCOMTest.dll
msbuild com/TestSources/PyCOMTest/PyCOMTest.sln -property:Configuration=Release
regsvr32 com/TestSources/PyCOMTest/x64/Release/PyCOMTest.dll

- name: Run tests
# Run the tests directly from the source dir so support files (eg, .wav files etc)
Expand All @@ -92,8 +94,8 @@ jobs:
# Later, when available, we can add tests using this wheel on ARM64 VMs
build_arm64:
name: Cross-compile ARM
runs-on: windows-2019
timeout-minutes: 20
runs-on: windows-2022
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -142,8 +144,8 @@ jobs:

# This job can be run locally by running `pre-commit run`
checkers:
runs-on: windows-2019
timeout-minutes: 20
runs-on: windows-2022
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -174,8 +176,8 @@ jobs:
if: ${{ !cancelled() }}

mypy:
runs-on: windows-2019
timeout-minutes: 20
runs-on: windows-2022
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
Expand All @@ -192,8 +194,8 @@ jobs:
- run: mypy . --python-version=${{ matrix.python-version }}

pyright:
runs-on: windows-2019
timeout-minutes: 20
runs-on: windows-2022
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 3 additions & 1 deletion com/TestSources/PyCOMTest/PyCOMTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{8EB3046C-6CE8-4537-9B58-6EDD46E6D632}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.22000.0</WindowsTargetPlatformVersion>
<!-- Target Windows Server 2022 which GitHub Actions run on -->
<!-- https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#windows-server-2022 -->
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __init__(
# CRYPT_DECRYPT_MESSAGE_PARA.dwflags is in an ifdef for some unknown reason
# See github PR #1444 for more details...
("CRYPT_DECRYPT_MESSAGE_PARA_HAS_EXTRA_FIELDS", None),
# Minimum Windows version supported (Windows 7 / Windows Server 2008)
# Minimum Windows version supported (Windows 7)
# https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt
("_WIN32_WINNT", hex(0x0601)),
("WINVER", hex(0x0601)),
Expand Down