Skip to content

Commit f8509c7

Browse files
committed
fix: platform dependency windows only
correct GitHub actions, package can run only on Windows due to PyWin32 dependency, corrections to pyproject.toml
1 parent d0456b2 commit f8509c7

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

.cruft.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"project_short_description": "Package with various utilities to support COM object development with Python based on PyWin32",
1212
"open_source_license": "GPL-3.0-only",
1313
"target_python_version": "3.9",
14+
"target_os_platform": "windows-latest",
1415
"github_username": "dornech",
1516
"project_repo": "https://github.com/dornech/utils-COMobjects",
1617
"pypi_username": "dornech",

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
build-test:
2424
strategy:
2525
matrix:
26-
os: [ubuntu-latest, macos-latest, windows-latest]
26+
os: [ windows-latest ]
2727
runs-on: ${{ matrix.os }}
2828
if: startsWith(github.ref, 'refs/tags/')
2929
steps:
@@ -51,7 +51,7 @@ jobs:
5151
verbose: true
5252

5353
build-distribution:
54-
runs-on: ubuntu-latest
54+
runs-on: windows-latest
5555
needs: build-test
5656
steps:
5757
- name: Check out the repository

.github/workflows/documentation.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,25 @@ jobs:
3737
run: echo "$GITHUB_CONTEXT"
3838

3939
build-documentation:
40-
runs-on: ubuntu-latest
40+
runs-on: windows-latest
4141
steps:
42+
- name: Install Cairo via MSYS2
43+
uses: msys2/setup-msys2@v2
44+
with:
45+
update: true
46+
install: mingw-w64-x86_64-cairo
47+
- name: Add MSYS2 Cairo to PATH to make cairocffi libraries like libcairo-2.dll discoverable
48+
shell: powershell
49+
# "C:\msys64\mingw64\bin" did not work, try "C:\Program Files\Unity Hub\resources\app.asar.unpacked\node_modules\canvas\build\Release"
50+
# found using Get-ChildItem -Path C:\ -Filter "*libcairo*.d*" -File -Recurse -ErrorAction SilentlyContinue in Log step
51+
run: |
52+
echo "C:\Program Files\Unity Hub\resources\app.asar.unpacked\node_modules\canvas\build\Release" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
53+
echo "CAIROCFFI_DLL_DIRECTORIES=C:\Program Files\Unity Hub\resources\app.asar.unpacked\node_modules\canvas\build\Release" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
54+
- name: Log environment variable updates
55+
shell: powershell
56+
run: |
57+
Write-Host "GITHUB_PATH: $env:PATH"
58+
Write-Host "CAIROCFFI_DLL_DIRECTORIES: $env:CAIROCFFI_DLL_DIRECTORIES"
4259
- name: Check out the repository
4360
uses: actions/checkout@v5
4461
- name: Set up Python

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
tests:
3030
strategy:
3131
matrix:
32-
os: [ ubuntu-latest, macos-latest, windows-latest ]
32+
os: [ windows-latest ]
3333
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
3434
runs-on: ${{ matrix.os }}
3535
steps:

pyproject.toml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf", "docs
120120
##################
121121

122122
[tool.docsig]
123-
check-class = true
123+
check-class = false
124124
check-class-constructor = true
125125
check-dunders = false
126126
check-nested = false
@@ -285,7 +285,7 @@ exclude_lines = [
285285

286286
# Hatch default environment
287287
[tool.hatch.envs.default]
288-
python = "3.11"
288+
# python = "3.9"
289289
post-install-commands = ["pre-commit install", "pre-commit install --hook-type commit-msg"]
290290
dependencies = [
291291
"pre-commit",
@@ -327,7 +327,7 @@ debug = "cov --no-cov -s --pdb --pdbcls=IPython.core.debugger:Pdb {args}"
327327
# Hatch testing environment matrix for various Python versions replacing the functionality of tox
328328
[[tool.hatch.envs.test.matrix]]
329329
template = ["test"]
330-
python = ["39", "310", "311", "312", "313"]
330+
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
331331

332332
# Hatch default linting environment for "hatch fmt"
333333
[tool.hatch.envs.hatch-static-analysis]
@@ -348,11 +348,11 @@ dependencies = [
348348
]
349349
[tool.hatch.envs.lint.scripts]
350350
typing = [
351-
"echo \"VERSION: `mypy --version`\"",
351+
"mypy --version",
352352
"mypy --install-types --non-interactive {args}"
353353
]
354354
style = [
355-
"echo \"VERSION: `ruff --version`\"",
355+
"ruff --version",
356356
"ruff check {args:.}",
357357
"ruff format --check {args:.}",
358358
]
@@ -361,13 +361,10 @@ fix = [
361361
"ruff check --fix {args:.}",
362362
"style", # feedback on what is not fixable
363363
]
364-
docsig = [
365-
"docsig",
366-
]
367364
all = [
368365
"style",
369366
"typing",
370-
"docsig",
367+
"docsig src",
371368
]
372369

373370
# Hatch environment for building documentation

0 commit comments

Comments
 (0)