Skip to content

Commit

Permalink
Merge branch 'main' into adodbapi-Update-collections-literals-and-com…
Browse files Browse the repository at this point in the history
…prehensions
  • Loading branch information
Avasam committed Apr 10, 2024
2 parents aad9450 + 4f39762 commit 8ed3963
Show file tree
Hide file tree
Showing 393 changed files with 4,359 additions and 7,203 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# A clang-format style that approximates Python's PEP 7
# Useful for IDE integration
BasedOnStyle: Google
AlwaysBreakAfterReturnType: All
AllowShortIfStatementsOnASingleLine: false
AlignAfterOpenBracket: Align
BreakBeforeBraces: Stroustrup
Expand Down
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
# TODO: Activate and run in a different PR. Lots of files affected
# trim_trailing_whitespace = true
# insert_final_newline = true
# end_of_line = crlf
indent_style = space
indent_size = 4
max_line_length = 120 # Same as .clang-format

[*.py]
max_line_length = 88 # Same as Black

[*.md]
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_size = 2
32 changes: 28 additions & 4 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
<!--
Note that issues in this repository are only for bugs or feature requests in the pywin32.
**If you need support or help using this package, please follow [these instructions](https://github.com/mhammond/pywin32/blob/master/README.md#support)** - support or help requests will be closed without comment.
-->

For all bugs, please provide the following information.
For all bugs, please provide the following information:

* Expected behavior and actual behavior.
## Expected behavior and actual behavior

* Steps to reproduce the problem.
## Steps to reproduce the problem
<!-- Prefer using code snippets rather than a screenshot. Please include a full minimal reproduction if possible. -->

* Version of Python and pywin32
1. ...
2. ...
3. ...

```python

```

## System information

Python version and distribution:
<!-- If uncertain, run: python -V -->

pywin32 version:

Installed from PyPI or exe installer:

Windows Version:
<!-- You can find this under "System Information", ie: Version 10.0.19045 Build 19045 -->

DLL locations:
<!-- Run: python -c "import pywintypes,pythoncom;print(pywintypes.__file__,pythoncom.__file__,sep='\n')" -->
70 changes: 35 additions & 35 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,68 @@ on:
create:
tags:
# 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*
- b[0-9][0-9][0-9]
- publish-docs*
push:
branches:
- main
- main

jobs:
decompile:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install latest release
run: pip install --user --upgrade pywin32
- 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: 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: Decompile shipped help file
run: hh -decompile site ${env:USER_DIR}\PyWin32.chm
- name: Decompile shipped help file
run: hh -decompile site ${env:USER_DIR}\PyWin32.chm

- name: Rename root HTML file
run: mv site\PyWin32.HTML site\index.html
- 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
- name: Create archive
run: python -m zipfile -c site.zip site

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

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

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

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

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

- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
commit_message: ${{ github.event.head_commit.message }}
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
commit_message: ${{ github.event.head_commit.message }}
# Write .nojekyll at the root, see:
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
enable_jekyll: false
enable_jekyll: false
# Only deploy if there were changes
allow_empty_commit: false
allow_empty_commit: false
6 changes: 3 additions & 3 deletions .github/workflows/download-arm64-libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

VERSION = "{}.{}.{}".format(*sys.version_info[:3])
if sys.version_info.releaselevel == "alpha":
VERSION += "-a{}".format(sys.version_info.serial)
VERSION += f"-a{sys.version_info.serial}"
if sys.version_info.releaselevel == "beta":
VERSION += "-b{}".format(sys.version_info.serial)
VERSION += f"-b{sys.version_info.serial}"
if sys.version_info.releaselevel == "candidate":
VERSION += "-rc{}".format(sys.version_info.serial)
VERSION += f"-rc{sys.version_info.serial}"

URL = f"https://www.nuget.org/api/v2/package/pythonarm64/{VERSION}"
PATH = dest / f"pythonarm64.{VERSION}.zip"
Expand Down
168 changes: 105 additions & 63 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on:
push:
pull_request:
branches:
- main
- main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
Expand All @@ -17,40 +21,40 @@ jobs:
architecture: ['x64', 'x86']

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}

- name: Setup environment
run: |
python --version
pip --version
pip install --upgrade setuptools wheel
- name: Build and install
run: |
python setup.py --skip-verstamp install --user
- 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 pywin32_testall.py -v -skip-adodbapi

- name: Build wheels
run: |
python setup.py bdist_wheel --skip-build
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: artifacts
path: |
dist/*.whl
dist/*.exe
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}

- name: Setup environment
run: |
python --version
pip --version
pip install --upgrade setuptools wheel
- name: Build and install
run: |
python setup.py --skip-verstamp install --user
- 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 pywin32_testall.py -v -skip-adodbapi

- name: Build wheels
run: |
python setup.py bdist_wheel --skip-build
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: artifacts
path: |
dist/*.whl
dist/*.exe
# We cannot build and test on ARM64, so we cross-compile.
# Later, when available, we can add tests using this wheel on ARM64 VMs
Expand All @@ -63,41 +67,79 @@ jobs:
python-version: ['3.10', '3.11', '3.12-dev']

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'

- name: Setup Environment
run: |
python --version
pip --version
pip install --upgrade setuptools wheel
- name: Obtain ARM64 library files
run: |
python .github\workflows\download-arm64-libs.py .\arm64libs
- name: Build wheels
run: python setup.py --skip-verstamp build_ext -L .\arm64libs --plat-name win-arm64 build --plat-name win-arm64 bdist_wheel --plat-name win-arm64

- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: artifacts
path: |
dist/*.whl
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'

- name: Setup Environment
run: |
python --version
pip --version
pip install --upgrade setuptools wheel
- name: Obtain ARM64 library files
run: |
python .github\workflows\download-arm64-libs.py .\arm64libs
- name: Build wheels
run: python setup.py --skip-verstamp build_ext -L .\arm64libs --plat-name win-arm64 build --plat-name win-arm64 bdist_wheel --plat-name win-arm64

- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: artifacts
path: |-
dist/*.whl
# This job can be run locally by running `pre-commit run`
checkers:
runs-on: ubuntu-latest
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# This job only needs to target the oldest supported version (black@stable supports Python >=3.8)
python-version: '3.8'
- run: pip install isort pycln
- run: pycln . --config=pycln.toml --check
- run: isort . --diff --check-only
- uses: psf/black@stable
with:
options: "--fast --check --diff --verbose"

mypy:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
# mypy 1.5 dropped support for python 3.7
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install types-regex types-setuptools mypy>=1.5
- run: mypy . --python-version=${{ matrix.python-version }}

pyright:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# pyright vendors typeshed, but let's make sure we have the most up to date stubs
- run: pip install types-regex types-setuptools
- uses: jakebailey/pyright-action@v2
with:
python-version: ${{ matrix.python-version }}
annotate: errors
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[isort]
py_version=37
py_version = 37
profile = black
combine_as_imports = true
skip = setup.py
Expand Down
Loading

0 comments on commit 8ed3963

Please sign in to comment.