Skip to content

Commit 1f6d66b

Browse files
committed
Don't require pywin32 for Windows.
1 parent 179f8c5 commit 1f6d66b

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,16 @@ jobs:
5656
sudo apt-get install graphviz graphviz-dev
5757
5858
- name: Run tests, doctests, and notebook tests
59+
if: matrix.os != 'windows-latest' || matrix.python-version != '3.14'
5960
shell: bash -l {0}
6061
run: just test-cov
6162

63+
# pywin32 has no wheels for Python 3.14 yet, so skip notebook tests
64+
- name: Run tests without notebook tests (Windows + Python 3.14)
65+
if: matrix.os == 'windows-latest' && matrix.python-version == '3.14'
66+
shell: bash -l {0}
67+
run: uv run --group test pytest --cov=src --cov=tests --cov-report=xml -n auto
68+
6269
- name: Upload test coverage reports to Codecov with GitHub Action
6370
uses: codecov/codecov-action@v5
6471

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ docs = [
6666
plugin-list = ["httpx>=0.27.0", "tabulate[widechars]>=0.9.0", "tqdm>=4.66.3"]
6767
test = [
6868
"deepdiff>=7.0.0",
69-
"nbmake>=1.5.5",
69+
# nbmake requires pywin32 on Windows, which has no wheels for Python 3.14 yet
70+
"nbmake>=1.5.5; platform_system != 'Windows' or python_version < '3.14'",
7071
"pygments>=2.18.0",
7172
"pexpect>=4.9.0",
7273
"pytest>=8.4.0",

tests/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111

1212
import pytest
1313
from click.testing import CliRunner
14-
from nbmake.pytest_items import NotebookItem
1514
from packaging import version
1615

16+
try:
17+
from nbmake.pytest_items import NotebookItem
18+
except ImportError:
19+
NotebookItem = None
20+
1721
from pytask import console
1822
from pytask import storage
1923

@@ -143,6 +147,8 @@ def run_in_subprocess(cmd: tuple[str, ...], cwd: Path | None = None) -> Result:
143147

144148
def pytest_collection_modifyitems(session, config, items) -> None: # noqa: ARG001
145149
"""Add markers to Jupyter notebook tests."""
150+
if NotebookItem is None:
151+
return
146152
for item in items:
147153
if isinstance(item, NotebookItem):
148154
item.add_marker(pytest.mark.xfail(reason="The tests are flaky."))

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)