Skip to content

Commit

Permalink
Merge branch 'main' into DispatchWithEvents-None-disp_class
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Nov 13, 2024
2 parents a89d4d8 + 0023fd3 commit 1e1ffb8
Show file tree
Hide file tree
Showing 375 changed files with 85,000 additions and 27,852 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ name: docs
on:
create:
tags:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- b[0-9][0-9][0-9]
- publish-docs*
push:
branches:
- main
pull_request: # Temporary just for test
branches:
- main

jobs:
decompile:
generate:
runs-on: windows-latest

steps:
Expand All @@ -22,44 +25,43 @@ jobs:
with:
python-version: '3.9'

# We still need to install pywin32 because
# AutoDuck/py2d.py currently relies on runtime imports for introspection
# Downloading latest release is faster than re-building
- name: Install latest release
run: pip install --user --upgrade pywin32

- name: Set Python user site directory
run: python -c "import os,site;open(os.environ['GITHUB_ENV'], 'a').write(f'USER_DIR={site.USER_SITE}\n')"
- name: Generate PyWin32.chm help file
run: python AutoDuck/make.py

- name: Decompile shipped help file
run: hh -decompile site ${env:USER_DIR}\PyWin32.chm
- name: Decompile help file into HTML
run: hh -decompile site PyWin32.chm

- name: Rename root HTML file
run: mv site\PyWin32.HTML site\index.html

# Compress first to avoid slowly uploading thousands of individual files
- name: Create archive
run: python -m zipfile -c site.zip site

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: documentation
path: site.zip
path: site/

publish:
runs-on: ubuntu-latest
needs:
- decompile
- generate

# Only publish tags
if: github.event_name == 'create' && github.event.ref_type == 'tag'

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: documentation

- name: Unpack archive
run: python -m zipfile -e site.zip .

- uses: peaceiris/actions-gh-pages@v3
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
run: |
python setup.py install --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 servces as a PR test for the docs.yaml workflow
- name: Generate PyWin32.chm help file
run: python AutoDuck/make.py

- 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.
Expand Down Expand Up @@ -143,7 +150,7 @@ jobs:
cache: pip
cache-dependency-path: .github/workflows/main.yml
check-latest: true
- run: pip install types-regex types-setuptools PyOpenGL mypy==1.11
- run: pip install types-setuptools PyOpenGL mypy==1.11
- run: mypy . --python-version=${{ matrix.python-version }}

pyright:
Expand All @@ -162,7 +169,7 @@ jobs:
cache-dependency-path: .github/workflows/main.yml
check-latest: true
# pyright vendors typeshed, but let's make sure we have the most up to date stubs
- run: pip install types-regex types-setuptools PyOpenGL
- run: pip install types-setuptools PyOpenGL
- uses: jakebailey/pyright-action@v2
with:
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion AutoDuck/README → AutoDuck/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Just run MAKE.BAT to build the documentation.
Just run [make.py](./make.py) to build the documentation.

Main focus these days is on the .chm file - a single .chm
provides the best documentation solution. We don't even
Expand Down
17 changes: 8 additions & 9 deletions AutoDuck/common_top.mak
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Common AutoDuck make file

AD = bin\autoduck.exe /Spythonwin.fmt
AD = bin\autoduck.exe /Spythonwin.fmt
ADHTMLFMT = bin\autoduck.exe /Spyhtml.fmt
ADHTMLLOG = /R html "/L$(GENDIR)\$(TARGET).HHLOG" /N
ADLOG = /R help "/L$(GENDIR)\$(TARGET).HLOG" /N
ADHTML = /R html "/G$(GENDIR)\$(TARGET).DUMP" "/C$(GENDIR)\$(TARGET).HHLOG" "/I$(GENDIR)\$(TARGET).IDX" "/O$(GENDIR)\$(TARGET).HTML" /D "title=$(TITLE)"
ADHLP = /R help "/C$(GENDIR)\$(TARGET).HLOG" "/O$(GENDIR)\$(TARGET).RTF" /D "title=$(TITLE)"
ADDOC = /RD "/O$(GENDIR)\$(TARGET).DOC" /D "doc_header=$(DOCHDR)"
ADTAB = 8
HC = hcw /a /c /e
HHC = hhc
PYTHON = py -2.7
ADLOG = /R help "/L$(GENDIR)\$(TARGET).HLOG" /N
ADHTML = /R html "/G$(GENDIR)\$(TARGET).DUMP" "/C$(GENDIR)\$(TARGET).HHLOG" "/I$(GENDIR)\$(TARGET).IDX" "/O$(GENDIR)\$(TARGET).HTML" /D "title=$(TITLE)"
ADHLP = /R help "/C$(GENDIR)\$(TARGET).HLOG" "/O$(GENDIR)\$(TARGET).RTF" /D "title=$(TITLE)"
ADDOC = /RD "/O$(GENDIR)\$(TARGET).DOC" /D "doc_header=$(DOCHDR)"
ADTAB = 8
HC = hcw /a /c /e
HHC = hhc
4 changes: 3 additions & 1 deletion AutoDuck/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
).splitlines()[-1]

subprocess.run(
[nmake, "-E", "-f", "pywin32.mak"], cwd=os.path.dirname(sys.argv[0]), check=True
[nmake, f'PYTHON="{sys.executable}"', "-E", "-f", "pywin32.mak"],
cwd=os.path.dirname(sys.argv[0]),
check=True,
)
2 changes: 1 addition & 1 deletion AutoDuck/makedfromi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def GetComments(line, lineNo, lines):
if len(data) != 2:
break
if data[0].strip():
break # Not a continutation!
break # Not a continuation!
if data[1].strip().startswith("@"):
# new command
break
Expand Down
31 changes: 14 additions & 17 deletions AutoDuck/py2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ def ad_escape(s):
return re.sub(r"([^<]*)<([^>]*)>", r"\g<1>\\<\g<2>\\>", s)


Print = __builtins__.__dict__["print"]


class DocInfo:
def __init__(self, name, ob):
self.name = name
Expand Down Expand Up @@ -75,7 +72,7 @@ def format_desc(desc):
# 'first_para_of_docstring'
# '@comm next para of docstring'
# '@comm next para of docstring' ... etc
# BUT - also handling enbedded doctests, where we write
# BUT - also handling embedded doctests, where we write
# '@iex >>> etc.'
if not desc:
return ""
Expand Down Expand Up @@ -112,30 +109,30 @@ def build_module(fp, mod_name):
elif name.upper() == name and isinstance(ob, (int, str)):
constants.append((name, ob))
info = BuildInfo(mod_name, mod)
Print(f"// @module {mod_name}|{format_desc(info.desc)}", file=fp)
print(f"// @module {mod_name}|{format_desc(info.desc)}", file=fp)
functions = [f for f in functions if should_build_function(f)]
for ob in functions:
Print(f"// @pymeth {ob.name}|{ob.short_desc}", file=fp)
print(f"// @pymeth {ob.name}|{ob.short_desc}", file=fp)
for ob in classes:
# only classes with docstrings get printed.
if not ob.ob.__doc__:
continue
ob_name = mod_name + "." + ob.name
Print(f"// @pyclass {ob.name}|{ob.short_desc}", file=fp)
print(f"// @pyclass {ob.name}|{ob.short_desc}", file=fp)
for ob in functions:
Print(
print(
f"// @pymethod |{mod_name}|{ob.name}|{format_desc(ob.desc)}",
file=fp,
)
for ai in BuildArgInfos(ob.ob):
Print(f"// @pyparm |{ai.name}|{ai.default}|{ai.short_desc}", file=fp)
print(f"// @pyparm |{ai.name}|{ai.default}|{ai.short_desc}", file=fp)

for ob in classes:
# only classes with docstrings get printed.
if not ob.ob.__doc__:
continue
ob_name = mod_name + "." + ob.name
Print(f"// @object {ob_name}|{format_desc(ob.desc)}", file=fp)
print(f"// @object {ob_name}|{format_desc(ob.desc)}", file=fp)
func_infos = []
# We need to iter the keys then to a getattr() so the funky descriptor
# things work.
Expand All @@ -146,20 +143,20 @@ def build_module(fp, mod_name):
if should_build_function(info):
func_infos.append(info)
for fi in func_infos:
Print(f"// @pymeth {fi.name}|{fi.short_desc}", file=fp)
print(f"// @pymeth {fi.name}|{fi.short_desc}", file=fp)
for fi in func_infos:
Print(
print(
f"// @pymethod |{ob_name}|{fi.name}|{format_desc(fi.desc)}",
file=fp,
)
if hasattr(fi.ob, "im_self") and fi.ob.im_self is ob.ob:
Print("// @comm This is a @classmethod.", file=fp)
Print(
print("// @comm This is a @classmethod.", file=fp)
print(
f"// @pymethod |{ob_name}|{fi.name}|{format_desc(fi.desc)}",
file=fp,
)
for ai in BuildArgInfos(fi.ob):
Print(
print(
f"// @pyparm |{ai.name}|{ai.default}|{ai.short_desc}",
file=fp,
)
Expand All @@ -168,11 +165,11 @@ def build_module(fp, mod_name):
desc = f"{name} = {val!r}"
if isinstance(val, int):
desc += f" (0x{val:x})"
Print(f"// @const {mod_name}|{name}|{desc}", file=fp)
print(f"// @const {mod_name}|{name}|{desc}", file=fp)


def main(fp, args):
Print("// @doc", file=fp)
print("// @doc", file=fp)
for arg in args:
build_module(sys.stdout, arg)

Expand Down
9 changes: 7 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ https://mhammond.github.io/pywin32_installers.html.
Coming in build 309, as yet unreleased
--------------------------------------

* Pythonwin: Bumped Scintilla from 1.77 to 4.4.6. The full changelog can be found here: https://www.scintilla.org/ScintillaHistory.html
* Fixed `ddeclient` and `ddeserver` demos import error (#2290, @Avasam)
* The `EvtSubscribe_push` demo now actually demonstrates the callback action and the event context being filled. (#2281, @Avasam)
* Fixed Pythonwin's editor failing due to invalid regex import (#2419, @Avasam)
* Last error wrongly set by some modules (#2302, @CristiFati)
* Dropped support for Python 3.7 (#2207, @Avasam)
* Implement the creation of SAFEARRAY(VT_RECORD) from a sequence of COM Records (#2317, @geppi)
* Implement record pointers as [in, out] method parameters of a Dispatch Interface (#2304, #2310, @geppi)
Expand Down Expand Up @@ -68,7 +73,7 @@ as the .chm file, certain MAPI libraries etc, and .exe installers.
* `win32com.client.build.error`
* `win32com.client.genpy.error`
* Add EnumDesktopWindows (#2219, @CristiFati)
* Marked `exc_type` and `exc_traceback` in `win32comext.axscript.client.error.AXScriptException.__init__` as deprecated. (#2236 , @Avasam)
* Marked `exc_type` and `exc_traceback` in `win32comext.axscript.client.error.AXScriptException.__init__` as deprecated. (#2236, @Avasam)
They are now unused and all information is taken from the `exc_value` parameter.
* Fixed non-overriden `pywin.scintilla.formatter.Formatter.ColorizeString` raising `TypeError` instead of `RuntimeError` due to too many parameters (#2216, @Avasam)
* Fixed broken since Python 3 tokenization in `win32comext.axdebug.codecontainer.pySourceCodeContainer.GetSyntaxColorAttributes` (#2216, @Avasam)
Expand Down Expand Up @@ -189,7 +194,7 @@ as the .chm file, certain MAPI libraries etc, and .exe installers.
* Use byte-string (`b""`) for constant bytes values instead of superfluous `.encode` calls (#2046, @Avasam)
* Cleaned up unused imports (#1986, #2051, #1990, #2124, #2126, @Avasam)
* Removed duplicated declarations, constants and definitions (#2050, #1950, #1990, @Avasam)
* Small generalized optimization by using augmented assignements (in-place operators) where possible (#2274, @Avasam)
* Small generalized optimization by using augmented assignments (in-place operators) where possible (#2274, @Avasam)
* General speed and size improvements due to all the removed code. (#2046, #1986, #2050, #1950, #2085, #2087, #2051, #1990, #2106, #2127, #2124, #2126, #2177, #2218, #2202, #2205, #2217)

### adodbapi
Expand Down
28 changes: 14 additions & 14 deletions Pythonwin/Scintilla/License.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ License for Scintilla and SciTE

Copyright 1998-2003 by Neil Hodgson <[email protected]>

All Rights Reserved
All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation.

NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
OR PERFORMANCE OF THIS SOFTWARE.
NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
OR PERFORMANCE OF THIS SOFTWARE.
Loading

0 comments on commit 1e1ffb8

Please sign in to comment.