diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a8ee81adf..bd6f60b301 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,185 +13,252 @@ concurrency: cancel-in-progress: true jobs: - test: - name: Build and test - runs-on: ${{ matrix.os }} + build_msys2_mingw: + runs-on: windows-2022 timeout-minutes: &timeout-minutes 25 + defaults: + run: + shell: msys2 {0} strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] - python-architecture: [x64, x86, arm64] include: - - os: windows-2022 - - python-architecture: arm64 - os: windows-11-arm - exclude: - # actions/setup-python does not provide prebuilt arm64 Python before 3.11 - - python-architecture: arm64 - python-version: "3.9" - - python-architecture: arm64 - python-version: "3.10" - env: - # TODO: We can't yet run tests with PYTHONDEVMODE=1, let's emulated it as much as we can - # https://docs.python.org/3/library/devmode.html#effects-of-the-python-development-mode - PYTHONMALLOC: debug - PYTHONASYNCIODEBUG: 1 - PYTHONWARNINGS: always - # PYTHONFAULTHANDLER: 1 # This causes our tests to fail - + - { sys: mingw64, env: x86_64, plat-name: win-amd64 } + - { sys: mingw32, env: i686, plat-name: win32 } + - { sys: ucrt64, env: ucrt-x86_64, plat-name: win-amd64 } + # No ARM yet, that currently requires using clang steps: - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - uses: msys2/setup-msys2@v2 with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.python-architecture }} - check-latest: true - allow-prereleases: true + msystem: ${{matrix.sys}} + update: true + # TODO: check if toolchain and are needed + install: | + mingw-w64-${{matrix.env}}-toolchain + mingw-w64-${{matrix.env}}-python + mingw-w64-${{matrix.env}}-python-build + mingw-w64-${{matrix.env}}-cc - name: Build and install - run: pip install . -v --user - - # This needs to happen *after* installing pywin32 since - # AutoDuck/py2d.py currently relies on runtime imports for introspection - # This isn't included in the wheel (TODO: could we?) - # and only serves as a PR test for the docs.yaml workflow - - name: Generate PyWin32.chm help file - run: python AutoDuck/make.py - - # Smokescreen test to validate postinstall doesn't crash, dlls can be found, and both pathless invocation methods work - - name: Run postinstall install/remove - run: | - $UserSite = "$(python -m site --user-site)" - python -m win32.scripts.pywin32_postinstall -install -destination "$UserSite" - pywin32_postinstall -remove -destination "$UserSite" - - # Compilation and registration of the PyCOMTest server dll - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - - name: Build and register the PyCOMTest server dll - # Pass Silent flag to regsvr32 to avoid hanging on confirmation window - run: com/TestSources/PyCOMTest/buildAndRegister.bat /s - - - name: Run tests - # Run the tests directly from the source dir so support files (eg, .wav files etc) - # can be found - they aren't installed into the Python tree. - run: python win32/scripts/pywin32_testall.py -v -skip-adodbapi - - - name: Build wheels - run: pip wheel . -v --wheel-dir=dist - + # Having to specify plat-name here is definitely hacky, not sure why setuptools fails with + # error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64') + run: python -m build -v --config-setting=--build-option="build_ext --plat-name=${{matrix.plat-name}} build --plat-name=${{matrix.plat-name}} bdist_wheel --plat-name=${{matrix.plat-name}}" - uses: actions/upload-artifact@v4 # Upload artifacts even if tests fail if: ${{ always() }} with: - name: artifacts-${{ matrix.python-version }}-${{ matrix.python-architecture }} + name: artifacts-${{matrix.sys}}-${{matrix.env}}-${{matrix.plat-name}} path: dist/*.whl if-no-files-found: error - # actions/setup-python does not provide prebuilt arm64 Python before 3.11, so we cross-compile. - cross_compile_arm64: - name: Cross-compile ARM64 + build_cygwin: runs-on: windows-2022 timeout-minutes: *timeout-minutes - strategy: - fail-fast: false - matrix: - # pythonarm64 NuGet has no download for Python ~=3.9.11 - python-version: ["3.9.10", "3.10"] + defaults: + run: + shell: bash -o igncr -eo pipefail '{0}' steps: - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: astral-sh/setup-uv@v7 + - uses: cygwin/cygwin-install-action@master with: - python-version: ${{ matrix.python-version }} - activate-environment: true - - - name: Obtain ARM64 library files - run: python .github\workflows\download-arm64-libs.py ./arm64libs - - - name: Build wheels - run: uv build --wheel --config-setting=--build-option="build_ext -L./arm64libs --plat-name=win-arm64 build --plat-name=win-arm64 bdist_wheel --plat-name=win-arm64" - + platform: x86_64 + packages: >- + gcc-core + python3-dev + python3-build + python3-tomli + - name: Disable CRLF line endings in git checkout + run: git config --global core.autocrlf input + - name: Build and install + run: python -m build -v - uses: actions/upload-artifact@v4 + # Upload artifacts even if tests fail + if: ${{ always() }} with: - name: artifacts-${{ matrix.python-version }}-arm64 + name: artifacts-cygwin path: dist/*.whl if-no-files-found: error - merge: - runs-on: ubuntu-latest - needs: [test, cross_compile_arm64] - steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 - with: - name: artifacts - pattern: artifacts-* - - name: Delete standalone Artifacts - uses: geekyeggo/delete-artifact@v5 - with: - name: artifacts-* + # test: + # name: Build and test + # runs-on: ${{ matrix.os }} + # timeout-minutes: *timeout-minutes + # strategy: + # fail-fast: false + # matrix: + # python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + # python-architecture: [x64, x86, arm64] + # include: + # - os: windows-2022 + # - python-architecture: arm64 + # os: windows-11-arm + # exclude: + # # actions/setup-python does not provide prebuilt arm64 Python before 3.11 + # - python-architecture: arm64 + # python-version: "3.9" + # - python-architecture: arm64 + # python-version: "3.10" + # env: + # # TODO: We can't yet run tests with PYTHONDEVMODE=1, let's emulated it as much as we can + # # https://docs.python.org/3/library/devmode.html#effects-of-the-python-development-mode + # PYTHONMALLOC: debug + # PYTHONASYNCIODEBUG: 1 + # PYTHONWARNINGS: always + # # PYTHONFAULTHANDLER: 1 # This causes our tests to fail - # This job can be run locally by running `pre-commit run` - checkers: - runs-on: ubuntu-latest - timeout-minutes: *timeout-minutes - steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v7 - with: - # This job only needs to target the oldest supported version - python-version: "3.9" - activate-environment: true - - run: uv pip install --group=checkers - - # !cancelled(): Show issues even if the previous steps failed. But still fail the job - - run: pycln . --config=pycln.toml --check - - - name: Run Ruff linter - uses: astral-sh/ruff-action@v3 - if: ${{ !cancelled() }} - - name: Run Ruff formatter - run: ruff format --check - if: ${{ !cancelled() }} - - # Too many files to fit in a single command, also exclude vendored Scintilla and MAPIStubLibrary - - run: | - clang-format --Werror --dry-run $(git ls-files '*.cpp' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') - if ($LastExitCode -ne 0) { exit $LastExitCode } - shell: pwsh - if: ${{ !cancelled() }} - - run: | - clang-format --Werror --dry-run $(git ls-files '*.h' ':!:Pythonwin/Scintilla/' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') - if ($LastExitCode -ne 0) { exit $LastExitCode } - shell: pwsh - if: ${{ !cancelled() }} - - type-checkers: - runs-on: ubuntu-latest - timeout-minutes: *timeout-minutes - strategy: - fail-fast: false - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] - steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v7 - with: - python-version: ${{ matrix.python-version }} - activate-environment: true - - run: uv pip install --group=type-checkers + # steps: + # - uses: actions/checkout@v4 - - run: mypy . --python-version=${{ matrix.python-version }} + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v6 + # with: + # python-version: ${{ matrix.python-version }} + # architecture: ${{ matrix.python-architecture }} + # check-latest: true + # allow-prereleases: true - - uses: jakebailey/pyright-action@v2 - with: - python-version: ${{ matrix.python-version }} - version: PATH - annotate: errors - if: ${{ !cancelled() }} # Show issues even if the previous steps failed. But still fail the job + # - name: Build and install + # run: pip install . -v --user + + # # This needs to happen *after* installing pywin32 since + # # AutoDuck/py2d.py currently relies on runtime imports for introspection + # # This isn't included in the wheel (TODO: could we?) + # # and only serves as a PR test for the docs.yaml workflow + # - name: Generate PyWin32.chm help file + # run: python AutoDuck/make.py + + # # Smokescreen test to validate postinstall doesn't crash, dlls can be found, and both pathless invocation methods work + # - name: Run postinstall install/remove + # run: | + # $UserSite = "$(python -m site --user-site)" + # python -m win32.scripts.pywin32_postinstall -install -destination "$UserSite" + # pywin32_postinstall -remove -destination "$UserSite" + + # # Compilation and registration of the PyCOMTest server dll + # - name: Add msbuild to PATH + # uses: microsoft/setup-msbuild@v2 + + # - name: Build and register the PyCOMTest server dll + # # Pass Silent flag to regsvr32 to avoid hanging on confirmation window + # run: com/TestSources/PyCOMTest/buildAndRegister.bat /s + + # - name: Run tests + # # Run the tests directly from the source dir so support files (eg, .wav files etc) + # # can be found - they aren't installed into the Python tree. + # run: python win32/scripts/pywin32_testall.py -v -skip-adodbapi + + # - name: Build wheels + # run: pip wheel . -v --wheel-dir=dist + + # - uses: actions/upload-artifact@v4 + # # Upload artifacts even if tests fail + # if: ${{ always() }} + # with: + # name: artifacts-${{ matrix.python-version }}-${{ matrix.python-architecture }} + # path: dist/*.whl + # if-no-files-found: error + + # # actions/setup-python does not provide prebuilt arm64 Python before 3.11, so we cross-compile. + # cross_compile_arm64: + # name: Cross-compile ARM64 + # runs-on: windows-2022 + # timeout-minutes: *timeout-minutes + # strategy: + # fail-fast: false + # matrix: + # # pythonarm64 NuGet has no download for Python ~=3.9.11 + # python-version: ["3.9.10", "3.10"] + # steps: + # - uses: actions/checkout@v4 + + # - name: Set up Python ${{ matrix.python-version }} + # uses: astral-sh/setup-uv@v7 + # with: + # python-version: ${{ matrix.python-version }} + # activate-environment: true + + # - name: Obtain ARM64 library files + # run: python .github\workflows\download-arm64-libs.py ./arm64libs + + # - name: Build wheels + # run: uv build --wheel --config-setting=--build-option="build_ext -L./arm64libs --plat-name=win-arm64 build --plat-name=win-arm64 bdist_wheel --plat-name=win-arm64" + + # - uses: actions/upload-artifact@v4 + # with: + # name: artifacts-${{ matrix.python-version }}-arm64 + # path: dist/*.whl + # if-no-files-found: error + + # merge: + # runs-on: ubuntu-latest + # needs: [test, cross_compile_arm64] + # steps: + # - name: Merge Artifacts + # uses: actions/upload-artifact/merge@v4 + # with: + # name: artifacts + # pattern: artifacts-* + # - name: Delete standalone Artifacts + # uses: geekyeggo/delete-artifact@v5 + # with: + # name: artifacts-* + + # # This job can be run locally by running `pre-commit run` + # checkers: + # runs-on: ubuntu-latest + # timeout-minutes: *timeout-minutes + # steps: + # - uses: actions/checkout@v4 + # - uses: astral-sh/setup-uv@v7 + # with: + # # This job only needs to target the oldest supported version + # python-version: "3.9" + # activate-environment: true + # - run: uv pip install --group=checkers + + # # !cancelled(): Show issues even if the previous steps failed. But still fail the job + # - run: pycln . --config=pycln.toml --check + + # - name: Run Ruff linter + # uses: astral-sh/ruff-action@v3 + # if: ${{ !cancelled() }} + # - name: Run Ruff formatter + # run: ruff format --check + # if: ${{ !cancelled() }} + + # # Too many files to fit in a single command, also exclude vendored Scintilla and MAPIStubLibrary + # - run: | + # clang-format --Werror --dry-run $(git ls-files '*.cpp' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') + # if ($LastExitCode -ne 0) { exit $LastExitCode } + # shell: pwsh + # if: ${{ !cancelled() }} + # - run: | + # clang-format --Werror --dry-run $(git ls-files '*.h' ':!:Pythonwin/Scintilla/' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') + # if ($LastExitCode -ne 0) { exit $LastExitCode } + # shell: pwsh + # if: ${{ !cancelled() }} + + # type-checkers: + # runs-on: ubuntu-latest + # timeout-minutes: *timeout-minutes + # strategy: + # fail-fast: false + # matrix: + # python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + # steps: + # - uses: actions/checkout@v4 + # - uses: astral-sh/setup-uv@v7 + # with: + # python-version: ${{ matrix.python-version }} + # activate-environment: true + # - run: uv pip install --group=type-checkers + + # - run: mypy . --python-version=${{ matrix.python-version }} + + # - uses: jakebailey/pyright-action@v2 + # with: + # python-version: ${{ matrix.python-version }} + # version: PATH + # annotate: errors + # if: ${{ !cancelled() }} # Show issues even if the previous steps failed. But still fail the job diff --git a/Pythonwin/Win32uiHostGlue.h b/Pythonwin/Win32uiHostGlue.h index 163e7581bc..17aaf35c89 100644 --- a/Pythonwin/Win32uiHostGlue.h +++ b/Pythonwin/Win32uiHostGlue.h @@ -5,7 +5,7 @@ // be in synch! Use a version number to check this. #define WIN32UIHOSTGLUE_VERSION 3 -#include "pywintypes.h" +#include "PyWinTypes.h" class Win32uiHostGlue : public CObject { public: diff --git a/Pythonwin/dllmain.cpp b/Pythonwin/dllmain.cpp index e319633e5c..1d0b13b3db 100644 --- a/Pythonwin/dllmain.cpp +++ b/Pythonwin/dllmain.cpp @@ -3,7 +3,7 @@ #include "stdafx.h" #include "afxdllx.h" -#include "win32uiHostGlue.h" +#include "Win32uiHostGlue.h" static HWND GetConsoleHwnd(void); diff --git a/Pythonwin/doc/EmbeddingWin32ui.html b/Pythonwin/doc/EmbeddingWin32ui.html index 50996cd72f..6382f56772 100644 --- a/Pythonwin/doc/EmbeddingWin32ui.html +++ b/Pythonwin/doc/EmbeddingWin32ui.html @@ -23,8 +23,8 @@
You must instantiate a Win32uiHostGlue class. This class is used as a glue between win32ui.pyd and the host .exe, and is defined in Win32uiHostGlue.h
Currently, this consists of about 5 methods that must be called by your application. The principle is that the Application must hook certain handlers, and delegate them to the HostGlue class. This will ensure the appropriate Win32ui internals are called.
The win32uihostglue.h module defines a class which makes interfacing fairly simple. This Win32uiHostGlue class is used as a glue between win32ui.pyd and the host .exe. In the most simple case, you need to instantiate one of the classes, and at certain key points in your CWinApp derived class, call the appropriate methods. You may choose to provide your own glue class derived from Win32uiHostGlue in certain cases.
+The Win32uiHostGlue.h module defines a class which makes interfacing fairly simple. This Win32uiHostGlue class is used as a glue between win32ui.pyd and the host .exe. In the most simple case, you need to instantiate one of the classes, and at certain key points in your CWinApp derived class, call the appropriate methods. You may choose to provide your own glue class derived from Win32uiHostGlue in certain cases.
Below is an example class, which overrides the "SetStatusText" method, so that status information displays in the applications status bar (this is only necessary if your application has a "non standard" status bar - normally you could omit this.).
GameApp NEAR theApp; // My existing CWinApp derived class.
// HostGlue class.
diff --git a/Pythonwin/pythonwin.cpp b/Pythonwin/pythonwin.cpp
index b61d44b4e5..78eff569ca 100644
--- a/Pythonwin/pythonwin.cpp
+++ b/Pythonwin/pythonwin.cpp
@@ -3,7 +3,7 @@
#include "stdafxpw.h"
#include "pythonwin.h"
-#include "win32uiHostGlue.h"
+#include "Win32uiHostGlue.h"
#ifdef _DEBUG
#undef THIS_FILE
diff --git a/Pythonwin/pywin/test/test_exe.py b/Pythonwin/pywin/test/test_exe.py
index d545bc6365..238e819f21 100644
--- a/Pythonwin/pywin/test/test_exe.py
+++ b/Pythonwin/pywin/test/test_exe.py
@@ -38,7 +38,7 @@ def setUp(self):
# install w symlink. This works only when cwd is set to the dir of
# python.exe / exec_prefix.
- # XXX Pythonwin.exe / win32uihostglue.h could be improved to search
+ # XXX Pythonwin.exe / Win32uiHostGlue.h could be improved to search
# the Python DLL itself via registry when local / relative search fails.
pydll = f"Python{sys.version_info.major}{sys.version_info.minor}.dll" # same for 32bit
diff --git a/Pythonwin/stdafx.h b/Pythonwin/stdafx.h
index cd558624a2..f2285d4d49 100644
--- a/Pythonwin/stdafx.h
+++ b/Pythonwin/stdafx.h
@@ -35,7 +35,7 @@ programmers who forget to use the new names. */
#include "pythonrun.h"
#include "import.h" // Python: for dynamicattach routines.
-#include "pywintypes.h"
+#include "PyWinTypes.h"
// don't need all of these for all, but it can't hurt (and keep the speed up!)
#include "win32ui.h"
@@ -48,6 +48,6 @@ programmers who forget to use the new names. */
#include "win32assoc.h"
#include "win32cmd.h"
-#include "win32app.h"
+#include "Win32app.h"
// --- EOF --- //
diff --git a/Pythonwin/stdafxdde.h b/Pythonwin/stdafxdde.h
index 1019b093f0..7d848b8365 100644
--- a/Pythonwin/stdafxdde.h
+++ b/Pythonwin/stdafxdde.h
@@ -13,7 +13,7 @@
// The Pythonwin stuff
#include "oleauto.h"
-#include "pywintypes.h"
+#include "PyWinTypes.h"
#include "win32ui.h"
#include "win32assoc.h"
diff --git a/Pythonwin/stdafxole.h b/Pythonwin/stdafxole.h
index 1731eb138a..d30a6907e5 100644
--- a/Pythonwin/stdafxole.h
+++ b/Pythonwin/stdafxole.h
@@ -30,7 +30,7 @@
// don't need all of these for all, but it can't hurt (and keep the speed up!)
-#include "pywintypes.h"
+#include "PyWinTypes.h"
#include "win32ui.h"
#include "win32assoc.h"
#include "win32cmd.h"
diff --git a/Pythonwin/win32oleDlgInsert.cpp b/Pythonwin/win32oleDlgInsert.cpp
index 8a312b4d03..9da5eb7d95 100644
--- a/Pythonwin/win32oleDlgInsert.cpp
+++ b/Pythonwin/win32oleDlgInsert.cpp
@@ -2,8 +2,8 @@
#include "win32dlg.h"
#include "win32oleDlgs.h"
-#include "pythoncom.h"
-#include "pywintypes.h"
+#include "PythonCOM.h"
+#include "PyWinTypes.h"
// @doc
// XXX - is this actually used?????????
diff --git a/Pythonwin/win32uimodule.cpp b/Pythonwin/win32uimodule.cpp
index e0207a2d06..fb2a916a81 100644
--- a/Pythonwin/win32uimodule.cpp
+++ b/Pythonwin/win32uimodule.cpp
@@ -12,7 +12,7 @@ generates Windows .hlp files.
*/
#include "stdafx.h"
#include
-#include "win32uiHostGlue.h"
+#include "Win32uiHostGlue.h"
#include "win32win.h"
#include "win32control.h"
#include "win32doc.h"
@@ -705,7 +705,7 @@ PyObject *Python_do_callback(PyObject *themeth, PyObject *thearglst)
return result;
}
-// Copied from PyRecord.cpp, should move into pywintypes.h
+// Copied from PyRecord.cpp, should move into PyWinTypes.h
// Unicode versions of '_Concat' etc have different sigs. Make them the
// same here...
void PyWinCoreString_Concat(register PyObject **pv, register PyObject *w)
diff --git a/Pythonwin/win32uioledoc.cpp b/Pythonwin/win32uioledoc.cpp
index 3291c64e98..0c70492212 100644
--- a/Pythonwin/win32uioledoc.cpp
+++ b/Pythonwin/win32uioledoc.cpp
@@ -1,8 +1,8 @@
#include "stdafxole.h"
-#include "win32app.h"
+#include "Win32app.h"
#include "win32uioledoc.h"
#include "win32template.h"
-#include "pywintypes.h"
+#include "PyWinTypes.h"
//
// OLE Document Object
//
diff --git a/build_mingw.ps1 b/build_mingw.ps1
new file mode 100644
index 0000000000..5d130701d4
--- /dev/null
+++ b/build_mingw.ps1
@@ -0,0 +1,13 @@
+#!/usr/bin/env pwsh
+if (-not $IsLinux) {
+ Write-Error "Linux required: use MSYS2 on Windows for native MinGW builds"
+ exit 1
+}
+
+$Env:CC = 'x86_64-w64-mingw32-gcc'
+$Env:CXX = 'x86_64-w64-mingw32-g++'
+$Env:AR = 'x86_64-w64-mingw32-ar'
+$Env:RANLIB = 'x86_64-w64-mingw32-ranlib'
+$Env:LDSHARED = 'x86_64-w64-mingw32-gcc -shared'
+
+uv pip install . --force-reinstall
diff --git a/com/win32com/src/oleargs.cpp b/com/win32com/src/oleargs.cpp
index 0e18d51d89..e19cd99c3e 100644
--- a/com/win32com/src/oleargs.cpp
+++ b/com/win32com/src/oleargs.cpp
@@ -19,7 +19,7 @@ static PyObject *PyVariant_Type;
// new array (old behaviour)
#define BYREF_ARRAY_USE_EXISTING_ARRAY
-// Need to put this in pywintypes.h with rest of compatibility macros
+// Need to put this in PyWinTypes.h with rest of compatibility macros
#define PYWIN_BUFFER_CHECK(obj) (PyBytes_Check(obj) || PyByteArray_Check(obj) || PyMemoryView_Check(obj))
// A little helper just for this file
diff --git a/com/win32comext/adsi/src/PyADSIUtil.cpp b/com/win32comext/adsi/src/PyADSIUtil.cpp
index 9aecc2674f..f420668040 100644
--- a/com/win32comext/adsi/src/PyADSIUtil.cpp
+++ b/com/win32comext/adsi/src/PyADSIUtil.cpp
@@ -1,7 +1,7 @@
// @doc
#include "Python.h"
#include "pyerrors.h" // for PyErr_Warn in 2.5...
-#include "Windows.h"
+#include "windows.h"
#include "PyWinTypes.h"
#include "PythonCOM.h"
#include "PyADSIUtil.h"
diff --git a/com/win32comext/adsi/src/adsilib.i b/com/win32comext/adsi/src/adsilib.i
index fa74a61bdd..86f0fac01b 100644
--- a/com/win32comext/adsi/src/adsilib.i
+++ b/com/win32comext/adsi/src/adsilib.i
@@ -1,7 +1,7 @@
/* ADSI SWIG Support */
%{
-#include "pyadsiutil.h"
+#include "PyADSIUtil.h"
extern PyObject *OleSetADSIError(HRESULT hr, IUnknown *pUnk, REFIID iid);
%}
diff --git a/com/win32comext/directsound/src/PyDSBCAPS.cpp b/com/win32comext/directsound/src/PyDSBCAPS.cpp
index 0f4100afad..af1326da5d 100644
--- a/com/win32comext/directsound/src/PyDSBCAPS.cpp
+++ b/com/win32comext/directsound/src/PyDSBCAPS.cpp
@@ -113,9 +113,9 @@ PyTypeObject PyDSBCAPSType = {
// application not using DirectSound. In this situation, the
// application's normal buffers are muted, but the sticky focus
// buffers are still audible. This is useful for nongame
- // applications, such as movie playback (DirectShow™), when the
+ // applications, such as movie playback (DirectShow�), when the
// user wants to hear the soundtrack while typing in Microsoft
- // Word or Microsoft® Excel, for example. However, if the user
+ // Word or Microsoft� Excel, for example. However, if the user
// switches to another DirectSound application, all sound
// buffers, both normal and sticky focus, in the previous
// application are muted.
diff --git a/com/win32comext/directsound/src/PyDSBUFFERDESC.cpp b/com/win32comext/directsound/src/PyDSBUFFERDESC.cpp
index 169d8121d5..794c8066d3 100644
--- a/com/win32comext/directsound/src/PyDSBUFFERDESC.cpp
+++ b/com/win32comext/directsound/src/PyDSBUFFERDESC.cpp
@@ -103,8 +103,8 @@ PyTypeObject PyDSBUFFERDESCType = {
// IDirectSound::CreateSoundBuffer call. With this flag set, an application using DirectSound can continue to play
// its sticky focus buffers if the user switches to another application not using DirectSound. In this situation,
// the application's normal buffers are muted, but the sticky focus buffers are still audible. This is useful for
- // nongame applications, such as movie playback (DirectShow™), when the user wants to hear the soundtrack while
- // typing in Microsoft Word or Microsoft® Excel, for example. However, if the user switches to another DirectSound
+ // nongame applications, such as movie playback (DirectShow�), when the user wants to hear the soundtrack while
+ // typing in Microsoft Word or Microsoft� Excel, for example. However, if the user switches to another DirectSound
// application, all sound buffers, both normal and sticky focus, in the previous application are muted.
// @flag DSBCAPS_GLOBALFOCUS|The buffer is a global sound buffer. With this flag set, an application using
// DirectSound can continue to play its buffers if the user switches focus to another application, even if the new
diff --git a/isapi/src/PyExtensionObjects.cpp b/isapi/src/PyExtensionObjects.cpp
index fd309a1daa..d142c9ffdc 100644
--- a/isapi/src/PyExtensionObjects.cpp
+++ b/isapi/src/PyExtensionObjects.cpp
@@ -25,7 +25,7 @@
// #define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h
#include "stdafx.h"
-#include "pywintypes.h"
+#include "PyWinTypes.h"
#include "Utils.h"
#include "PyExtensionObjects.h"
#include "PythonEng.h"
diff --git a/isapi/src/PyFilterObjects.cpp b/isapi/src/PyFilterObjects.cpp
index 917420297a..7dce4414fc 100644
--- a/isapi/src/PyFilterObjects.cpp
+++ b/isapi/src/PyFilterObjects.cpp
@@ -25,9 +25,9 @@
// #define PY_SSIZE_T_CLEAN // defined by isapi\src\StdAfx.h
#include "stdafx.h"
-#include "pywintypes.h"
+#include "PyWinTypes.h"
#include "Utils.h"
-#include "pyFilterObjects.h"
+#include "PyFilterObjects.h"
// @doc
diff --git a/isapi/src/PythonEng.cpp b/isapi/src/PythonEng.cpp
index f58deea79a..0827c88770 100644
--- a/isapi/src/PythonEng.cpp
+++ b/isapi/src/PythonEng.cpp
@@ -29,8 +29,8 @@
#include "stdafx.h"
#include "Utils.h"
#include "PythonEng.h"
-#include "pyExtensionObjects.h"
-#include "pyFilterObjects.h"
+#include "PyExtensionObjects.h"
+#include "PyFilterObjects.h"
#include "pyISAPI_messages.h"
extern HINSTANCE g_hInstance;
diff --git a/isapi/src/pyISAPI.cpp b/isapi/src/pyISAPI.cpp
index 12c789cb59..6838fc213b 100644
--- a/isapi/src/pyISAPI.cpp
+++ b/isapi/src/pyISAPI.cpp
@@ -28,8 +28,8 @@
#include "stdafx.h"
#include "pyISAPI.h"
-#include "pyExtensionObjects.h"
-#include "pyFilterObjects.h"
+#include "PyExtensionObjects.h"
+#include "PyFilterObjects.h"
static const char *name_ext_factory = "__ExtensionFactory__";
static const char *name_ext_init = "GetExtensionVersion";
diff --git a/setup.py b/setup.py
index 4ca3671255..741d9d50c4 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,6 @@
import re
import shutil
import sys
-import winreg
from abc import abstractmethod
from collections.abc import Iterable
from pathlib import Path
@@ -48,18 +47,23 @@
from setuptools._distutils import ccompiler
from setuptools._distutils._msvccompiler import MSVCCompiler
from setuptools._distutils.command.install_data import install_data
+ from setuptools._distutils.compilers.C.cygwin import MinGW32Compiler
else:
from distutils import ccompiler
from distutils._msvccompiler import MSVCCompiler
from distutils.command.install_data import install_data
+ from distutils.compilers.C.cygwin import MinGW32Compiler
+# workaround until https://github.com/pypa/distutils/pull/399 is fixed
+MinGW32Compiler.initialize = lambda *_: None
+
+is_mingw = "MSC" not in sys.version
def my_new_compiler(**kw):
- if "compiler" in kw and kw["compiler"] in (None, "msvc"):
+ if not is_mingw and "compiler" in kw and kw["compiler"] in (None, "msvc"):
return my_compiler()
return orig_new_compiler(**kw)
-
# No way to cleanly wedge our compiler sub-class in.
orig_new_compiler = ccompiler.new_compiler
ccompiler.new_compiler = my_new_compiler # type: ignore[assignment] # Assuming the caller will always use only kwargs
@@ -166,7 +170,7 @@ def __init__(
def finalize_options(self, build_ext):
# distutils doesn't define this function for an Extension - it is
# our own invention, and called just before the extension is built.
- if not build_ext.mingw32:
+ if not is_mingw:
# bugger - add this to python!
if build_ext.plat_name == "win32":
self.extra_link_args.append("/MACHINE:x86")
@@ -235,14 +239,14 @@ def __init__(self, name, **kw):
WinExt.__init__(self, name, **kw)
def get_pywin32_dir(self):
- return "pythonwin"
+ return "Pythonwin"
class WinExt_pythonwin_subsys_win(WinExt_pythonwin):
def finalize_options(self, build_ext):
WinExt_pythonwin.finalize_options(self, build_ext)
- if build_ext.mingw32:
+ if is_mingw:
self.extra_link_args.append("-mwindows")
else:
self.extra_link_args.append("/SUBSYSTEM:WINDOWS")
@@ -271,49 +275,15 @@ def __init__(self, name, **kw):
def get_pywin32_dir(self):
return "win32comext/" + self.name
-
-# Exchange extensions get special treatment:
-# * Look for the Exchange SDK in the registry.
-# * Output directory is different than the module's basename.
-# * Require use of the Exchange 2000 SDK - this works for both VC6 and 7
-# NOTE: sadly the old Exchange SDK does *not* include MAPI files - these used
-# to be bundled with the Windows SDKs and/or Visual Studio, but no longer are.
class WinExt_win32com_mapi(WinExt_win32com):
def __init__(self, name, **kw):
- # The Exchange 2000 SDK seems to install itself without updating
- # LIB or INCLUDE environment variables. It does register the core
- # directory in the registry tho - look it up
- sdk_install_dir = None
libs = kw.get("libraries", "")
- keyname = r"SOFTWARE\Microsoft\Exchange\SDK"
- flags = winreg.KEY_READ
- try:
- flags |= winreg.KEY_WOW64_32KEY
- except AttributeError:
- pass # this version doesn't support 64 bits, so must already be using 32bit key.
- for root in winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER:
- try:
- keyob = winreg.OpenKey(root, keyname, 0, flags)
- value, type_id = winreg.QueryValueEx(keyob, "INSTALLDIR")
- if type_id == winreg.REG_SZ:
- sdk_install_dir = value
- break
- except OSError:
- pass
- if sdk_install_dir is not None:
- d = os.path.join(sdk_install_dir, "SDK", "Include")
- if os.path.isdir(d):
- kw.setdefault("include_dirs", []).insert(0, d)
- d = os.path.join(sdk_install_dir, "SDK", "Lib")
- if os.path.isdir(d):
- kw.setdefault("library_dirs", []).insert(0, d)
-
# The stand-alone exchange SDK has these libs
# Additional utility functions are only available for 32-bit builds.
if not platform.machine() in ("AMD64", "ARM64"):
libs += " version user32 advapi32 Ex2KSdk sadapi netapi32"
kw["libraries"] = libs
- WinExt_win32com.__init__(self, name, **kw)
+ super().__init__(name, **kw)
def get_pywin32_dir(self):
# 'win32com.mapi.exchange' is currently the only
@@ -332,7 +302,7 @@ class WinExt_pythonservice(WinExt):
def finalize_options(self, build_ext):
WinExt.finalize_options(self, build_ext)
- if build_ext.mingw32:
+ if is_mingw:
self.extra_link_args.append("-mconsole")
self.extra_link_args.append("-municode")
else:
@@ -373,8 +343,7 @@ def finalize_options(self) -> None:
# The pywintypes library is created in the build_temp
# directory, so we need to add this to library_dirs
self.library_dirs.append(self.build_temp)
- self.mingw32 = self.compiler == "mingw32" # type: ignore[comparison-overlap] # compiler is a string until `run` is run
- if self.mingw32:
+ if is_mingw:
self.libraries.append("stdc++")
self.excluded_extensions: list[tuple[WinExt, str]] = []
@@ -423,7 +392,7 @@ def _why_cant_build_extension(self, ext):
return None # no reason - it can be built!
def _build_scintilla(self):
- path = "pythonwin\\Scintilla"
+ path = "Pythonwin/Scintilla"
makefile = "makefile_pythonwin"
makeargs = []
@@ -482,7 +451,7 @@ def _build_scintilla(self):
base_name = "scintilla.dll"
self.copy_file(
os.path.join(self.build_temp, "scintilla", base_name),
- os.path.join(self.build_lib, "pythonwin"),
+ os.path.join(self.build_lib, "Pythonwin"),
)
# find the VC base path corresponding to distutils paths, and
@@ -499,7 +468,7 @@ def _check_vc(self):
if m:
atlmfc_found = True # ATLMFC libs/includes already found by distutils
- if not vcbase and not self.mingw32:
+ if not vcbase and not is_mingw:
print("-- compiler.library_dirs:", self.compiler.library_dirs)
# Error or warn? last hope would be a non-standard build environment
print("-- Visual C base path not found !?")
@@ -546,7 +515,7 @@ def build_extensions(self):
self.found_libraries = {}
- if hasattr(self.compiler, "initialize") and not self.compiler.initialized:
+ if isinstance(self.compiler, MSVCCompiler) and not self.compiler.initialized:
self.compiler.initialize()
# XXX this distutils class var peek hack should become obsolete
@@ -570,7 +539,7 @@ def build_extensions(self):
vcbase, vcverdir = self._check_vc()
# Here we hack a "pywin32" directory (one of 'win32', 'win32com',
- # 'pythonwin' etc), as distutils doesn't seem to like the concept
+ # 'Pythonwin' etc), as distutils doesn't seem to like the concept
# of multiple top-level directories.
assert self.package is None
@@ -663,7 +632,7 @@ def build_extensions(self):
def build_exefile(self, ext):
suffix = "_d" if self.debug else ""
logging.info("building exe '%s'", ext.name)
- leaf_name = f"{ext.get_pywin32_dir()}\\{ext.name}{suffix}.exe"
+ leaf_name = f"{ext.get_pywin32_dir()}/{ext.name}{suffix}.exe"
full_name = os.path.join(self.build_lib, leaf_name)
sources = list(ext.sources)
@@ -793,7 +762,7 @@ def find_swig(self):
swig = os.environ["SWIG"]
else:
# We know where our swig is
- swig = os.path.abspath("swig\\swig.exe")
+ swig = os.path.abspath("swig/swig.exe")
lib = os.path.join(os.path.dirname(swig), "swig_lib")
os.environ["SWIG_LIB"] = lib
return swig
@@ -1100,7 +1069,7 @@ def finalize_options(self):
WinExt_win32(
"win32evtlog",
sources="""
- win32\\src\\win32evtlog_messages.mc win32\\src\\win32evtlog.i
+ win32/src/win32evtlog_messages.mc win32/src/win32evtlog.i
""".split(),
libraries="advapi32 oleaut32",
delay_load_libraries="wevtapi",
@@ -1213,29 +1182,29 @@ def finalize_options(self):
).split(),
depends=(
"""
- {win32com}/include\\propbag.h {win32com}/include\\PyComTypeObjects.h
- {win32com}/include\\PyFactory.h {win32com}/include\\PyGConnectionPoint.h
- {win32com}/include\\PyGConnectionPointContainer.h
- {win32com}/include\\PyGPersistStorage.h {win32com}/include\\PyIBindCtx.h
- {win32com}/include\\PyICatInformation.h {win32com}/include\\PyICatRegister.h
- {win32com}/include\\PyIDataObject.h {win32com}/include\\PyIDropSource.h
- {win32com}/include\\PyIDropTarget.h {win32com}/include\\PyIEnumConnectionPoints.h
- {win32com}/include\\PyIEnumConnections.h {win32com}/include\\PyIEnumFORMATETC.h
- {win32com}/include\\PyIEnumGUID.h {win32com}/include\\PyIEnumSTATPROPSETSTG.h
- {win32com}/include\\PyIEnumSTATSTG.h {win32com}/include\\PyIEnumString.h
- {win32com}/include\\PyIEnumVARIANT.h {win32com}/include\\PyIExternalConnection.h
- {win32com}/include\\PyIGlobalInterfaceTable.h {win32com}/include\\PyILockBytes.h
- {win32com}/include\\PyIMoniker.h {win32com}/include\\PyIOleWindow.h
- {win32com}/include\\PyIPersist.h {win32com}/include\\PyIPersistFile.h
- {win32com}/include\\PyIPersistStorage.h {win32com}/include\\PyIPersistStream.h
- {win32com}/include\\PyIPersistStreamInit.h {win32com}/include\\PyIRunningObjectTable.h
- {win32com}/include\\PyIStorage.h {win32com}/include\\PyIStream.h
- {win32com}/include\\PythonCOM.h {win32com}/include\\PythonCOMRegister.h
- {win32com}/include\\PythonCOMServer.h {win32com}/include\\stdafx.h
- {win32com}/include\\univgw_dataconv.h
- {win32com}/include\\PyICancelMethodCalls.h {win32com}/include\\PyIContext.h
- {win32com}/include\\PyIEnumContextProps.h {win32com}/include\\PyIClientSecurity.h
- {win32com}/include\\PyIServerSecurity.h
+ {win32com}/include/propbag.h {win32com}/include/PyComTypeObjects.h
+ {win32com}/include/PyFactory.h {win32com}/include/PyGConnectionPoint.h
+ {win32com}/include/PyGConnectionPointContainer.h
+ {win32com}/include/PyGPersistStorage.h {win32com}/include/PyIBindCtx.h
+ {win32com}/include/PyICatInformation.h {win32com}/include/PyICatRegister.h
+ {win32com}/include/PyIDataObject.h {win32com}/include/PyIDropSource.h
+ {win32com}/include/PyIDropTarget.h {win32com}/include/PyIEnumConnectionPoints.h
+ {win32com}/include/PyIEnumConnections.h {win32com}/include/PyIEnumFORMATETC.h
+ {win32com}/include/PyIEnumGUID.h {win32com}/include/PyIEnumSTATPROPSETSTG.h
+ {win32com}/include/PyIEnumSTATSTG.h {win32com}/include/PyIEnumString.h
+ {win32com}/include/PyIEnumVARIANT.h {win32com}/include/PyIExternalConnection.h
+ {win32com}/include/PyIGlobalInterfaceTable.h {win32com}/include/PyILockBytes.h
+ {win32com}/include/PyIMoniker.h {win32com}/include/PyIOleWindow.h
+ {win32com}/include/PyIPersist.h {win32com}/include/PyIPersistFile.h
+ {win32com}/include/PyIPersistStorage.h {win32com}/include/PyIPersistStream.h
+ {win32com}/include/PyIPersistStreamInit.h {win32com}/include/PyIRunningObjectTable.h
+ {win32com}/include/PyIStorage.h {win32com}/include/PyIStream.h
+ {win32com}/include/PythonCOM.h {win32com}/include/PythonCOMRegister.h
+ {win32com}/include/PythonCOMServer.h {win32com}/include/stdafx.h
+ {win32com}/include/univgw_dataconv.h
+ {win32com}/include/PyICancelMethodCalls.h {win32com}/include/PyIContext.h
+ {win32com}/include/PyIEnumContextProps.h {win32com}/include/PyIClientSecurity.h
+ {win32com}/include/PyIServerSecurity.h
""".format(**dirs)
).split(),
libraries="oleaut32 ole32 user32 urlmon",
@@ -1739,7 +1708,7 @@ def finalize_options(self):
"Pythonwin/ddemodule.cpp",
"Pythonwin/ddeserver.cpp",
],
- depends=["win32/src/stddde.h", "pythonwin/ddemodule.h"],
+ depends=["win32/src/stddde.h", "Pythonwin/ddemodule.h"],
optional_headers=["afxres.h"],
),
]
@@ -1848,15 +1817,18 @@ def expand_modules(module_dir: str | os.PathLike[str]):
# NOTE: somewhat counter-intuitively, a result list a-la:
-# [('Lib/site-packages\\pythonwin', ('pythonwin/License.txt',)),]
+# [('Lib/site-packages/pythonwin', ('Pythonwin/License.txt',)),]
# will 'do the right thing' in terms of installing License.txt into
-# 'Lib/site-packages/pythonwin/License.txt'. We exploit this to
+# 'Lib/site-packages/Pythonwin/License.txt'. We exploit this to
# get 'com/win32com/whatever' installed to 'win32com/whatever'
def convert_data_files(files: Iterable[str]):
ret: list[tuple[str, tuple[str]]] = []
for file in files:
+ print("file:", file)
file = os.path.normpath(file)
if file.find("*") >= 0:
+ print('if file.find("*") >= 0', True)
+
files_use = tuple(
str(path)
for path in Path(file).parent.rglob(os.path.basename(file))
@@ -1866,10 +1838,12 @@ def convert_data_files(files: Iterable[str]):
if not files_use:
raise RuntimeError("No files match '%s'" % file)
else:
+ print('if file.find("*") >= 0', False)
if not os.path.isfile(file):
raise RuntimeError("No file '%s'" % file)
files_use = (file,)
for fname in files_use:
+ print("fname:", fname)
path_use = os.path.dirname(fname).removeprefix("com\\")
ret.append((path_use, (fname,)))
return ret
@@ -1934,7 +1908,7 @@ def convert_optional_data_files(files):
"adodbapi",
]
-py_modules = [*expand_modules("win32\\lib"), "win32\\winxpgui"]
+py_modules = [*expand_modules("win32/lib"), "win32/winxpgui"]
ext_modules = (
win32_extensions + com_extensions + pythonwin_extensions + other_extensions
)
@@ -2002,7 +1976,7 @@ def convert_optional_data_files(files):
package_dir={
"win32com": "com/win32com",
"win32comext": "com/win32comext",
- "pythonwin": "pythonwin",
+ "pythonwin": "Pythonwin",
},
packages=packages,
py_modules=py_modules,
@@ -2010,10 +1984,10 @@ def convert_optional_data_files(files):
+ convert_data_files(
[
"Pythonwin/start_pythonwin.pyw",
- "pythonwin/pywin/*.cfg",
- "pythonwin/pywin/Demos/*.py",
- "pythonwin/pywin/Demos/app/*.py",
- "pythonwin/pywin/Demos/ocx/*.py",
+ "Pythonwin/pywin/*.cfg",
+ "Pythonwin/pywin/Demos/*.py",
+ "Pythonwin/pywin/Demos/app/*.py",
+ "Pythonwin/pywin/Demos/ocx/*.py",
"win32/scripts/*.py",
"win32/test/*.py",
"win32/test/win32rcparser/test.rc",
@@ -2025,8 +1999,8 @@ def convert_optional_data_files(files):
"com/win32com/readme.html",
# Licenses
"com/win32comext/mapi/NOTICE.md",
- "pythonwin/License.txt",
- "pythonwin/pywin/idle/*.txt",
+ "Pythonwin/License.txt",
+ "Pythonwin/pywin/idle/*.txt",
"win32/License.txt",
# win32com test utility files.
"com/win32com/test/*.idl",
@@ -2043,10 +2017,10 @@ def convert_optional_data_files(files):
"com/win32comext/axscript/test/*.py",
"com/win32comext/axscript/test/*.pys",
"com/win32comext/axscript/test/*.vbs",
- "com/win32comext/axscript/Demos/*.pys",
- "com/win32comext/axscript/Demos/*.htm*",
- "com/win32comext/axscript/Demos/*.gif",
- "com/win32comext/axscript/Demos/*.asp",
+ "com/win32comext/axscript/demos/*.pys",
+ "com/win32comext/axscript/demos/*.htm*",
+ "com/win32comext/axscript/demos/*.gif",
+ "com/win32comext/axscript/demos/*.asp",
"com/win32comext/mapi/demos/*.py",
"com/win32comext/propsys/test/*.py",
"com/win32comext/shell/test/*.py",
@@ -2084,7 +2058,7 @@ def convert_optional_data_files(files):
# And data files convert_data_files can't handle.
+ [
("", (str(version_file_path),)),
- ("pythonwin", (str(scintilla_licence_path),)),
+ ("Pythonwin", (str(scintilla_licence_path),)),
("win32comext/mapi", (str(mapi_stubs_licence_path),)),
("win32com", ("com/License.txt",)),
("win32comext", ("com/License.txt",)),
diff --git a/win32/src/PerfMon/PyPerfMon.cpp b/win32/src/PerfMon/PyPerfMon.cpp
index fc4decfc76..e4e29957e2 100644
--- a/win32/src/PerfMon/PyPerfMon.cpp
+++ b/win32/src/PerfMon/PyPerfMon.cpp
@@ -13,7 +13,7 @@ generates Windows .hlp files.
******************************************************************/
#include "PyWinTypes.h"
-#include "Pyperfmon.h"
+#include "pyperfmon.h"
#include "tchar.h"
extern PyObject *PerfmonMethod_NewPERF_COUNTER_DEFINITION(PyObject *self, PyObject *args);
diff --git a/win32/src/PyOVERLAPPED.cpp b/win32/src/PyOVERLAPPED.cpp
index 5a5af5a8db..272392ae04 100644
--- a/win32/src/PyOVERLAPPED.cpp
+++ b/win32/src/PyOVERLAPPED.cpp
@@ -110,7 +110,7 @@ PYWINTYPES_EXPORT PyTypeObject PyOVERLAPPEDType = {
{"Offset", T_ULONG,
OFF(m_overlapped.Offset)}, // @prop integer|Offset|Specifies a file position at which to start the transfer. The
// file position is a byte offset from the start of the file. The calling process sets
- // this member before calling the ReadFile or WriteFile function. This member is
+ // this member before calling the ReadFile�or WriteFile function. This member is
// ignored when reading from or writing to named pipes and communications devices.
{"OffsetHigh", T_ULONG, OFF(m_overlapped.OffsetHigh)}, // @prop integer|OffsetHigh|Specifies the high word of the
// byte offset at which to start the transfer.
@@ -123,7 +123,7 @@ PYWINTYPES_EXPORT PyTypeObject PyOVERLAPPEDType = {
{"hEvent", T_OBJECT, OFF(obDummy)}, // @prop |hEvent|Identifies an event set to the signaled state when
// the transfer has been completed. The calling process sets this member before
// calling the , , , or function.
+ // win32pipe.ConnectNamedPipe>, or �function.
{"Internal", T_OBJECT,
OFF(obDummy)}, // @prop integer|Internal|Reserved for operating system use. (pointer-sized value)
{"InternalHigh", T_OBJECT,
diff --git a/win32/src/PyTime.cpp b/win32/src/PyTime.cpp
index e728c3ff03..00524f9bc8 100644
--- a/win32/src/PyTime.cpp
+++ b/win32/src/PyTime.cpp
@@ -417,7 +417,7 @@ PyObject *PyWinTimeObject_Fromtime_t(time_t t)
}
// Converts a TimeStamp, which is in 100 nanosecond units like a FILETIME
-// See comments in pywintypes.h re LARGE_INTEGER vs TimeStamp
+// See comments in PyWinTypes.h re LARGE_INTEGER vs TimeStamp
PyObject *PyWinObject_FromTimeStamp(const LARGE_INTEGER &ts)
{
FILETIME ft;
diff --git a/win32/src/PyWAVEFORMATEX.cpp b/win32/src/PyWAVEFORMATEX.cpp
index e7f89462c3..4f1520ab9b 100644
--- a/win32/src/PyWAVEFORMATEX.cpp
+++ b/win32/src/PyWAVEFORMATEX.cpp
@@ -112,7 +112,7 @@ PYWINTYPES_EXPORT PyTypeObject PyWAVEFORMATEXType = {
// nBlockAlign should be equal to the product of nChannels and
// wBitsPerSample divided by 8 (bits per byte). For non-PCM
// formats, this member must be computed according to the
- // manufacturer’s specification of the format tag.
+ // manufacturer�s specification of the format tag.
{"wBitsPerSample", T_SHORT, OFF(m_wfx.wBitsPerSample), 0,
"Bits per sample for the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM, then wBitsPerSample should be "
"equal to 8 or 16."}, // @prop integer|wBitsPerSample|Bits per sample for the wFormatTag format type. If
diff --git a/win32/src/PyWinTypes.h b/win32/src/PyWinTypes.h
index 36b39b9585..e0f5920009 100644
--- a/win32/src/PyWinTypes.h
+++ b/win32/src/PyWinTypes.h
@@ -4,7 +4,7 @@
// If building under a GCC, tweak what we need.
#if defined(__GNUC__) && defined(_POSIX_C_SOURCE)
-// python.h complains if _POSIX_C_SOURCE is already defined
+// Python.h complains if _POSIX_C_SOURCE is already defined
#undef _POSIX_C_SOURCE
#endif
diff --git a/win32/src/PyWinTypesmodule.cpp b/win32/src/PyWinTypesmodule.cpp
index d348ec2a0f..4579019b6b 100644
--- a/win32/src/PyWinTypesmodule.cpp
+++ b/win32/src/PyWinTypesmodule.cpp
@@ -71,7 +71,7 @@ PyObject *PyBuffer_FromMemory(void *buf, Py_ssize_t size)
return PyMemoryView_FromBuffer(&info);
}
-// See comments in pywintypes.h for why we need this!
+// See comments in PyWinTypes.h for why we need this!
void PyWin_MakePendingCalls()
{
while (1) {
@@ -633,7 +633,7 @@ BOOL PyWinObject_AsSimplePARAM(PyObject *ob, WPARAM *wparam)
// Converts for WPARAM and LPARAM: int or str (WCHAR*) or buffer (pointer to its locked memory)
// (WPARAM is defined as UINT_PTR, and LPARAM is defined as LONG_PTR - see
-// pywintypes.h for inline functions to resolve this)
+// PyWinTypes.h for inline functions to resolve this)
BOOL PyWinObject_AsPARAM(PyObject *ob, PyWin_PARAMHolder *holder)
{
assert(!PyErr_Occurred()); // lingering exception?
diff --git a/win32/src/_winxptheme.i b/win32/src/_winxptheme.i
index 29ac971051..cffa3ce286 100644
--- a/win32/src/_winxptheme.i
+++ b/win32/src/_winxptheme.i
@@ -16,7 +16,7 @@
%{
#undef PyHANDLE
-#include "pywinobjects.h"
+#include "PyWinObjects.h"
#include "windows.h"
#include "Uxtheme.h"
#include "CommCtrl.h"
diff --git a/win32/src/timermodule.cpp b/win32/src/timermodule.cpp
index 7336897473..7f2a5d29a0 100644
--- a/win32/src/timermodule.cpp
+++ b/win32/src/timermodule.cpp
@@ -8,7 +8,7 @@
// @doc - Contains autoduck comments for documentation
-#include "pywintypes.h"
+#include "PyWinTypes.h"
// #include "abstract.h"
static PyObject *timer_id_callback_map = NULL;
diff --git a/win32/src/win32clipboardmodule.cpp b/win32/src/win32clipboardmodule.cpp
index 65077657cb..699199b750 100644
--- a/win32/src/win32clipboardmodule.cpp
+++ b/win32/src/win32clipboardmodule.cpp
@@ -15,7 +15,7 @@
#define PY_SSIZE_T_CLEAN // this should be Py_ssize_t clean!
-#include "pywintypes.h"
+#include "PyWinTypes.h"
#define CHECK_NO_ARGS2(args, fnName) \
do { \
diff --git a/win32/src/win32dynamicdialog.cpp b/win32/src/win32dynamicdialog.cpp
index 2b1992d677..a1543b27af 100644
--- a/win32/src/win32dynamicdialog.cpp
+++ b/win32/src/win32dynamicdialog.cpp
@@ -37,8 +37,8 @@
#include "CommCtrl.h"
#include "windowsx.h" // For edit control hacks.
-#include "pywintypes.h"
-#include "pywinobjects.h"
+#include "PyWinTypes.h"
+#include "PyWinObjects.h"
#include "tchar.h"
#define BASED_CODE
diff --git a/win32/src/win32file.i b/win32/src/win32file.i
index fec0e8bb06..5a203c0e32 100644
--- a/win32/src/win32file.i
+++ b/win32/src/win32file.i
@@ -42,7 +42,7 @@
#include "winsock2.h"
#include "mswsock.h"
-#include "pywintypes.h"
+#include "PyWinTypes.h"
#include "winbase.h"
#include "assert.h"
#include
diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i
index d7c36cd658..8cff6650aa 100644
--- a/win32/src/win32gui.i
+++ b/win32/src/win32gui.i
@@ -8,7 +8,7 @@
%{
#undef PyHANDLE
-#include "pywinobjects.h"
+#include "PyWinObjects.h"
#include "winuser.h"
#include "CommCtrl.h"
#include "windowsx.h" // For edit control hacks.
diff --git a/win32/src/win32inet.i b/win32/src/win32inet.i
index 3093dab4f6..24d1018de3 100644
--- a/win32/src/win32inet.i
+++ b/win32/src/win32inet.i
@@ -2,7 +2,7 @@
// @doc
%module win32inet // An interface to the Windows internet (wininet) API
%{
-#include "Windows.h"
+#include "windows.h"
#include "WinInet.h"
#undef BOOLAPI // wininet.h defines this!
%}
@@ -12,7 +12,7 @@
%{
#undef PyHANDLE // undef earlier define, so we are back to the class.
-#include "pywinobjects.h"
+#include "PyWinObjects.h"
void CALLBACK PyHINTERNET_StatusChange(
HINTERNET hInternet,
diff --git a/win32/src/win32inet_winhttp.cpp b/win32/src/win32inet_winhttp.cpp
index a3292da67a..2c7b0ea1a1 100644
--- a/win32/src/win32inet_winhttp.cpp
+++ b/win32/src/win32inet_winhttp.cpp
@@ -6,8 +6,8 @@
// The intent is to only wrap stuff which isn't otherwise doable from
// Python, such as the proxy stuff.
-#include "pywintypes.h"
-#include "pywinobjects.h"
+#include "PyWinTypes.h"
+#include "PyWinObjects.h"
#include "winhttp.h"
// @doc
diff --git a/win32/src/win32lzmodule.cpp b/win32/src/win32lzmodule.cpp
index 651bdcfc87..9ac5406387 100644
--- a/win32/src/win32lzmodule.cpp
+++ b/win32/src/win32lzmodule.cpp
@@ -11,7 +11,7 @@ generates Windows .hlp files.
******************************************************************/
-#include "Pywintypes.h"
+#include "PyWinTypes.h"
#include "lzexpand.h"
static PyObject *obHandleMap = NULL;
diff --git a/win32/src/win32rasmodule.cpp b/win32/src/win32rasmodule.cpp
index d8207009fd..2b6d859e54 100644
--- a/win32/src/win32rasmodule.cpp
+++ b/win32/src/win32rasmodule.cpp
@@ -11,7 +11,7 @@ generates Windows .hlp files.
******************************************************************/
-#include "pywintypes.h"
+#include "PyWinTypes.h"
#include "ras.h"
#include "raserror.h"
diff --git a/win32/src/win32wnet/PyNCB.cpp b/win32/src/win32wnet/PyNCB.cpp
index e2290be5d1..ee73e803ce 100644
--- a/win32/src/win32wnet/PyNCB.cpp
+++ b/win32/src/win32wnet/PyNCB.cpp
@@ -17,9 +17,9 @@
******************************************************************/
// @doc
-#include "Pywintypes.h"
+#include "PyWinTypes.h"
#include
-#include "python.h"
+#include "Python.h"
#include "PyNCB.h"
#include
diff --git a/win32/src/win32wnet/PyNetresource.cpp b/win32/src/win32wnet/PyNetresource.cpp
index 9d928b326e..8e258aeb3b 100644
--- a/win32/src/win32wnet/PyNetresource.cpp
+++ b/win32/src/win32wnet/PyNetresource.cpp
@@ -18,7 +18,7 @@
// @doc
#include "PyWinTypes.h"
-#include "netres.h" // C++ header file for NETRESOURCE object
+#include "Netres.h" // C++ header file for NETRESOURCE object
static PyObject *NETRESOURCE_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
diff --git a/win32/src/win32wnet/win32wnet.cpp b/win32/src/win32wnet/win32wnet.cpp
index fe5c6ccb12..a57ff9d897 100644
--- a/win32/src/win32wnet/win32wnet.cpp
+++ b/win32/src/win32wnet/win32wnet.cpp
@@ -38,8 +38,8 @@
#include "PyWinTypes.h"
#include "PyWinObjects.h" // for the PyHANDLE impl.
-#include "netres.h" // NETRESOURCE Type
-#include "pyncb.h"
+#include "Netres.h" // NETRESOURCE Type
+#include "PyNCB.h"
/****************************************************************************
HELPER FUNCTIONS