Skip to content

Commit 686fafb

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

File tree

17 files changed

+139
-184
lines changed

17 files changed

+139
-184
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ max_line_length = 88 # Same as Ruff's default
1414
[*.md]
1515
trim_trailing_whitespace = false
1616
17-
[*.{yaml,yml,json,toml,clang-format}]
17+
[*.{yaml,yml,json,toml,clang-format,vcxproj}]
1818
indent_size = 2
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://github.com/actions/runner-images/issues/9701
2+
# Adapted from https://github.com/actions/runner-images/issues/9873#issuecomment-2139288682
3+
4+
import os
5+
import platform
6+
from itertools import chain
7+
from subprocess import check_call, check_output
8+
9+
os.chdir("C:/Program Files (x86)/Microsoft Visual Studio/Installer")
10+
vs_install_path = check_output(
11+
(
12+
"vswhere.exe",
13+
"-latest",
14+
"-products",
15+
"*",
16+
"-requires",
17+
"Microsoft.Component.MSBuild",
18+
"-property",
19+
"installationPath",
20+
),
21+
text=True,
22+
shell=True,
23+
).strip()
24+
components_to_add = (
25+
["Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64"]
26+
if platform.machine() == "ARM64"
27+
else ["Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL"]
28+
)
29+
args = (
30+
"vs_installer.exe",
31+
"modify",
32+
"--installPath",
33+
vs_install_path,
34+
*chain.from_iterable([("--add", component) for component in components_to_add]),
35+
"--quiet",
36+
"--norestart",
37+
)
38+
print(*args)
39+
40+
# Should be run twice for some reason
41+
print("First run...")
42+
check_call(args)
43+
print("Second run...")
44+
check_call(args)

.github/workflows/main.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
25+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
2626
python-architecture: [x64, x86, arm64]
2727
include:
28-
- os: windows-2019
28+
- os: windows-2022
2929
- python-architecture: arm64
3030
os: windows-11-arm
3131
exclude:
@@ -75,25 +75,11 @@ jobs:
7575
pywin32_postinstall -remove -destination "$UserSite"
7676
7777
# Compilation and registration of the PyCOMTest server dll
78-
- name: Set up MSVC
78+
- name: Add msbuild to PATH
7979
uses: microsoft/setup-msbuild@v2
8080

81-
# See https://github.com/actions/runner-images/issues/9701
82-
# Adapted from https://github.com/actions/runner-images/issues/9873#issuecomment-2139288682
8381
- name: Install missing Visual Studio components
84-
if: matrix.os != 'windows-2019' # Only an issue on newer versions of Windows
85-
run: |
86-
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
87-
$VsInstallPath = vswhere.exe -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
88-
[string]$ComponentsToAdd = @(
89-
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL"
90-
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64"
91-
) | ForEach-Object {"--add $_"}
92-
$ArgumentList = ('modify', '--installPath', "`"$VsInstallPath`"", $ComponentsToAdd, '--quiet', '--norestart', '--nocache')
93-
echo "vs_installer.exe $($ArgumentList -join ' ')"
94-
# should be run twice for some reason
95-
Start-Process -FilePath vs_installer.exe -ArgumentList $ArgumentList -Wait -PassThru -WindowStyle Hidden
96-
Start-Process -FilePath vs_installer.exe -ArgumentList $ArgumentList -Wait -PassThru -WindowStyle Hidden
82+
run: python .github\workflows\install-vs-components.py
9783

9884
- name: Build and register the PyCOMTest server dll
9985
run: |
@@ -119,7 +105,7 @@ jobs:
119105
# actions/setup-python does not provide prebuilt arm64 Python before 3.11, so we cross-compile.
120106
cross_compile_arm64:
121107
name: Cross-compile ARM64
122-
runs-on: windows-2019
108+
runs-on: windows-2022
123109
timeout-minutes: 25
124110
strategy:
125111
fail-fast: false
@@ -169,7 +155,7 @@ jobs:
169155

170156
# This job can be run locally by running `pre-commit run`
171157
checkers:
172-
runs-on: windows-2019
158+
runs-on: windows-2022
173159
timeout-minutes: 25
174160
steps:
175161
- uses: actions/checkout@v4
@@ -201,7 +187,7 @@ jobs:
201187
if: ${{ !cancelled() }}
202188
203189
mypy:
204-
runs-on: windows-2019
190+
runs-on: windows-2022
205191
timeout-minutes: 25
206192
strategy:
207193
fail-fast: false
@@ -215,16 +201,16 @@ jobs:
215201
cache: pip
216202
cache-dependency-path: .github/workflows/main.yml
217203
check-latest: true
218-
- run: pip install types-setuptools PyOpenGL mypy[faster-cache]==1.14.*
204+
- run: pip install types-setuptools PyOpenGL mypy==1.16.*
219205
- run: mypy . --python-version=${{ matrix.python-version }}
220206

221207
pyright:
222-
runs-on: windows-2019
208+
runs-on: windows-2022
223209
timeout-minutes: 25
224210
strategy:
225211
fail-fast: false
226212
matrix:
227-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
213+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
228214
steps:
229215
- uses: actions/checkout@v4
230216
- uses: actions/setup-python@v5

AutoDuck/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@ provides the best documentation solution. We don't even
55
build a .hlp file anymore.
66

77
pywin32-document.xml provides the front-page for the docs.
8+
9+
---
10+
11+
# [AutoDuck 2.0](http://helpmaster.info/hlp-developmentaids-autoduck.htm)
12+
13+
Autoduck is a command-line utility that extracts specially tagged comment blocks from programming source files and generates rich text files containing the contents of those comment blocks. Autoduck has traditionally been used to document programming APIs. Placing API documentation within the source files helps programmers disseminate information about a developing codebase. Autoduck can generate online Help files containing full hypertext coding with links and keyword lists. Typically, Autoduck is integrated into the build process, so a new Help database can be automatically generated each build.
14+
15+
_Freeware by Eric Artzt_
16+
17+
- [Download (includes documentation, examples and source)](https://web.archive.org/web/20070326125446/http://www.appletmaster.de/zip/autoduck.zip)

Pythonwin/Win32uiHostGlue.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,7 @@ inline Win32uiHostGlue::Win32uiHostGlue()
9191
}
9292
inline Win32uiHostGlue::~Win32uiHostGlue() {}
9393

94-
inline HKEY Win32uiHostGlue::GetRegistryRootKey()
95-
{
96-
// different for win32s.
97-
OSVERSIONINFO ver;
98-
ver.dwOSVersionInfoSize = sizeof(ver);
99-
GetVersionEx(&ver);
100-
return ver.dwPlatformId == VER_PLATFORM_WIN32s ? HKEY_CLASSES_ROOT : HKEY_LOCAL_MACHINE;
101-
}
94+
inline HKEY Win32uiHostGlue::GetRegistryRootKey() { return HKEY_LOCAL_MACHINE; }
10295

10396
#ifndef LINK_WITH_WIN32UI
10497

Pythonwin/pythonwin.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -109,27 +109,7 @@ BOOL CPythonWinApp::OnIdle(LONG lCount)
109109
return glue.OnIdle(lCount);
110110
}
111111

112-
CDocument *CPythonWinApp::OpenDocumentFile(LPCTSTR lpszFileName)
113-
{
114-
#if 0 // win32s no longer supported
115-
ver.dwOSVersionInfoSize = sizeof(ver);
116-
GetVersionEx(&ver);
117-
ver.dwOSVersionInfoSize = sizeof(ver);
118-
GetVersionEx(&ver);
119-
if (ver.dwPlatformId == VER_PLATFORM_WIN32s) {
120-
OutputDebugString("Win32s - Searching templates!\n");
121-
POSITION posTempl = m_pDocManager->GetFirstDocTemplatePosition();
122-
CDocTemplate* pTemplate = m_pDocManager->GetNextDocTemplate(posTempl);
123-
if (pTemplate)
124-
return pTemplate->OpenDocumentFile(lpszFileName);
125-
else {
126-
AfxMessageBox("win32s error - There is no template to use");
127-
return NULL;
128-
}
129-
} else
130-
#endif
131-
return CWinApp::OpenDocumentFile(lpszFileName);
132-
}
112+
CDocument *CPythonWinApp::OpenDocumentFile(LPCTSTR lpszFileName) { return CWinApp::OpenDocumentFile(lpszFileName); }
133113

134114
int CPythonWinApp::Run()
135115
{

Pythonwin/pywin/framework/app.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,10 @@ def InitInstance(self):
128128
HookInput()
129129
numMRU = win32ui.GetProfileVal("Settings", "Recent File List Size", 10)
130130
win32ui.LoadStdProfileSettings(numMRU)
131-
# self._obj_.InitMDIInstance()
132-
if win32api.GetVersionEx()[0] < 4:
133-
win32ui.SetDialogBkColor()
134-
win32ui.Enable3dControls()
131+
# self._obj_.InitMDIInstance()
135132

136133
# install a "callback caller" - a manager for the callbacks
137-
# self.oldCallbackCaller = win32ui.InstallCallbackCaller(self.CallbackManager)
134+
# self.oldCallbackCaller = win32ui.InstallCallbackCaller(self.CallbackManager)
138135
self.LoadMainFrame()
139136
self.SetApplicationPaths()
140137

build_env.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This describes how to setup the build environment for pywin32.
44

55
Double check the compiler version you need in the [Python wiki](https://wiki.python.org/moin/WindowsCompilers)
6-
but note that Python 3.5 -> 3.13 all use version 14.X of the compiler, which,
6+
but note that Python 3.5+ all use version 14.X of the compiler, which,
77
confusingly, report themselves as V.19XX (eg, note in Python's banner,
88
3.5's "MSC v.1900", even 3.9b4's "MSC v.1924")
99

com/TestSources/PyCOMTest/PyCOMTest.vcxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
<VCProjectVersion>17.0</VCProjectVersion>
2323
<ProjectGuid>{8EB3046C-6CE8-4537-9B58-6EDD46E6D632}</ProjectGuid>
2424
<Keyword>Win32Proj</Keyword>
25-
<WindowsTargetPlatformVersion>10.0.22000.0</WindowsTargetPlatformVersion>
25+
<!-- Target Windows Server 2022 which GitHub Actions run on -->
26+
<!-- https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#windows-server-2022 -->
27+
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
2628
</PropertyGroup>
2729
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2830
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

com/win32comext/axdebug/src/AXDebug.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,14 @@ static PyObject *SetThreadStateTrace(PyObject *self, PyObject *args)
180180
PyThreadState *state;
181181
if (!PyWinLong_AsVoidPtr(obhandle, (void **)&state))
182182
return NULL;
183-
#if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 2) || PY_MAJOR_VERSION > 2
184183
#pragma message("XXXXXXXXX - upgrade this for new tracing features.")
185-
/***
186-
XXX - maybe use PyEval_SetTrace ????
184+
/***
185+
// XXX - This was the code for Python<2.3: maybe use PyEval_SetTrace ????
187186
Py_XDECREF(state->c_tracefunc);
188187
state->c_tracefunc = func;
189188
state->tracing = TRUE;
190-
***/
191-
#else
192-
Py_XDECREF(state->sys_tracefunc);
193-
state->sys_tracefunc = func;
194-
Py_INCREF(func);
195-
#endif
189+
***/
190+
196191
// Loop back over all frames, setting each frame back to our
197192
// first script block frame with the tracer.
198193
PyFrameObject *frame = state ? state->frame : NULL;

0 commit comments

Comments
 (0)