Skip to content

Commit 332635f

Browse files
committed
Merge branch 'main' of https://github.com/mhammond/pywin32 into Native-ARM64-CI-wheels
2 parents 686fafb + 50777ab commit 332635f

File tree

5 files changed

+36
-43
lines changed

5 files changed

+36
-43
lines changed

.github/workflows/docs.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Python
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: '3.9'
26+
python-version: "3.9"
2727

2828
# We still need to install pywin32 because
2929
# AutoDuck/py2d.py currently relies on runtime imports for introspection
@@ -57,17 +57,15 @@ jobs:
5757
- uses: actions/download-artifact@v4
5858
with:
5959
name: documentation
60-
61-
- name: Unpack archive
62-
run: python -m zipfile -e site.zip .
60+
path: site
6361

6462
- uses: peaceiris/actions-gh-pages@v4
6563
with:
6664
github_token: ${{ secrets.GITHUB_TOKEN }}
6765
publish_dir: site
6866
commit_message: ${{ github.event.head_commit.message }}
69-
# Write .nojekyll at the root, see:
70-
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
67+
# Write .nojekyll at the root, see:
68+
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
7169
enable_jekyll: false
72-
# Only deploy if there were changes
70+
# Only deploy if there were changes
7371
allow_empty_commit: false

.github/workflows/main.yml

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68
branches:
79
- main
@@ -18,7 +20,7 @@ jobs:
1820
test:
1921
name: Build and test
2022
runs-on: ${{ matrix.os }}
21-
timeout-minutes: 25
23+
timeout-minutes: 30
2224
strategy:
2325
fail-fast: false
2426
matrix:
@@ -48,6 +50,7 @@ jobs:
4850
cache: pip
4951
cache-dependency-path: .github/workflows/main.yml
5052
check-latest: true
53+
allow-prereleases: true
5154

5255
- name: Fix user Scripts missing from PATH
5356
if: matrix.python-architecture == 'x86' || matrix.python-architecture == 'arm64'
@@ -82,9 +85,8 @@ jobs:
8285
run: python .github\workflows\install-vs-components.py
8386

8487
- name: Build and register the PyCOMTest server dll
85-
run: |
86-
msbuild com/TestSources/PyCOMTest/PyCOMTest.sln -property:Configuration=Release
87-
regsvr32 com/TestSources/PyCOMTest/x64/Release/PyCOMTest.dll
88+
# Pass Silent flag to regsvr32 to avoid hanging on confirmation window
89+
run: com/TestSources/PyCOMTest/buildAndRegister.bat /s
8890

8991
- name: Run tests
9092
# Run the tests directly from the source dir so support files (eg, .wav files etc)
@@ -106,7 +108,7 @@ jobs:
106108
cross_compile_arm64:
107109
name: Cross-compile ARM64
108110
runs-on: windows-2022
109-
timeout-minutes: 25
111+
timeout-minutes: 30
110112
strategy:
111113
fail-fast: false
112114
matrix:
@@ -123,9 +125,10 @@ jobs:
123125
cache: pip
124126
cache-dependency-path: .github/workflows/main.yml
125127
check-latest: true
128+
allow-prereleases: true
126129

127130
- name: Install build module
128-
run: pip install --upgrade build
131+
run: pip install --upgrade build
129132

130133
- name: Obtain ARM64 library files
131134
run: python .github\workflows\download-arm64-libs.py ./arm64libs
@@ -156,7 +159,7 @@ jobs:
156159
# This job can be run locally by running `pre-commit run`
157160
checkers:
158161
runs-on: windows-2022
159-
timeout-minutes: 25
162+
timeout-minutes: 30
160163
steps:
161164
- uses: actions/checkout@v4
162165
- uses: actions/setup-python@v5
@@ -186,13 +189,13 @@ jobs:
186189
if ($LastExitCode -ne 0) { exit $LastExitCode }
187190
if: ${{ !cancelled() }}
188191
189-
mypy:
192+
type-checkers:
190193
runs-on: windows-2022
191-
timeout-minutes: 25
194+
timeout-minutes: 30
192195
strategy:
193196
fail-fast: false
194197
matrix:
195-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
198+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
196199
steps:
197200
- uses: actions/checkout@v4
198201
- uses: actions/setup-python@v5
@@ -201,28 +204,14 @@ jobs:
201204
cache: pip
202205
cache-dependency-path: .github/workflows/main.yml
203206
check-latest: true
207+
allow-prereleases: true
204208
- run: pip install types-setuptools PyOpenGL mypy==1.16.*
209+
205210
- run: mypy . --python-version=${{ matrix.python-version }}
206211

207-
pyright:
208-
runs-on: windows-2022
209-
timeout-minutes: 25
210-
strategy:
211-
fail-fast: false
212-
matrix:
213-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
214-
steps:
215-
- uses: actions/checkout@v4
216-
- uses: actions/setup-python@v5
217-
with:
218-
python-version: ${{ matrix.python-version }}
219-
cache: pip
220-
cache-dependency-path: .github/workflows/main.yml
221-
check-latest: true
222-
# pyright vendors typeshed, but let's make sure we have the most up to date stubs
223-
- run: pip install types-setuptools PyOpenGL
224212
- uses: jakebailey/pyright-action@v2
225213
with:
226214
python-version: ${{ matrix.python-version }}
227-
version: "1.1.396"
215+
version: "1.1.401"
228216
annotate: errors
217+
if: ${{ !cancelled() }} # Show issues even if the previous steps failed. But still fail the job
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
msbuild %~dp0\PyCOMTest.sln -property:Configuration=Release
2+
regsvr32 %~dp0\x64\Release\PyCOMTest.dll %*

com/win32com/test/readme.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ In general, this should just run the best it can, utilizing what is available
1313
on the machine. It is likely some tests will refuse to run due to objects not
1414
being locally available - this is normal.
1515

16-
The win32com source tree has source code to a C++ and VB component used purely
16+
The `com/TestSources/` directory has source code to a C++ and VB component used purely
1717
for testing. You may like to build and register these, particularly if you
1818
are doing anything related to argument/result handling.
19+
You can run `com/TestSources/PyCOMTest/buildAndRegister.bat` directly.

com/win32com/test/testPyComTest.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import win32timezone
1818
import winerror
1919
from win32api import CloseHandle, GetCurrentProcessId, OpenProcess
20+
from win32com import universal
2021
from win32com.client import (
2122
VARIANT,
2223
CastTo,
@@ -29,8 +30,6 @@
2930
from win32com.universal import RegisterInterfaces
3031
from win32process import GetProcessMemoryInfo
3132

32-
importMsg = "**** PyCOMTest is not installed ***\n PyCOMTest is a Python test specific COM client and server.\n It is likely this server is not installed on this machine\n To install the server, you must get the win32com sources\n and build it using MS Visual C++"
33-
3433
# This test uses a Python implemented COM server - ensure correctly registered.
3534
win32com.test.util.RegisterPythonServer(
3635
os.path.join(os.path.dirname(__file__), "..", "servers", "test_pycomtest.py"),
@@ -41,10 +40,14 @@
4140
gencache.EnsureModule(
4241
"{6BCDCB60-5605-11D0-AE5F-CADD4C000000}", 0, 1, 1, bForDemand=False
4342
)
44-
except pythoncom.com_error:
45-
print("The PyCOMTest module can not be located or generated.")
46-
print(importMsg)
47-
raise RuntimeError(importMsg)
43+
except pythoncom.com_error as error:
44+
importMsg = """*** PyCOMTest is not installed ***
45+
PyCOMTest is a Python test specific COM client and server.
46+
It is likely this server is not installed on this machine
47+
To install the server, you must get the win32com sources
48+
and build it using MS Visual C++"""
49+
print(f"The PyCOMTest module can not be located or generated.\n{importMsg}\n")
50+
raise RuntimeError(importMsg) from error
4851

4952
verbose = 0
5053

@@ -69,7 +72,7 @@ class TestStruct2(pythoncom.com_record):
6972
GUID = "{78F0EA07-B7CF-42EA-A251-A4C6269F76AF}"
7073

7174

72-
# We don't need to stick with the struct name in the TypeLibrry for the subclass name.
75+
# We don't need to stick with the struct name in the TypeLibrary for the subclass name.
7376
# The following class has the same GUID as TestStruct2 from the TypeLibrary.
7477
class ArrayOfStructsTestStruct(pythoncom.com_record):
7578
__slots__ = ()

0 commit comments

Comments
 (0)