Skip to content

Commit

Permalink
fnctl is not supported on Windows, prefetch testing data
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Feb 14, 2024
1 parent 8495f74 commit 04d114c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
matrix:
include:
# Windows builds
- tox-env: py39-coverage
- tox-env: py39-prefetch-coverage
python-version: "3.9"
markers: -m 'not slow'
os: windows-latest
Expand Down
11 changes: 10 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import re
import shutil
import sys
import time
import warnings
from datetime import datetime as dt
Expand Down Expand Up @@ -474,7 +475,15 @@ def gather_session_data(threadsafe_data_dir, worker_id, xdoctest_namespace):
):
if helpers.PREFETCH_TESTING_DATA:
print("`XCLIM_PREFETCH_TESTING_DATA` set. Prefetching testing data...")
if worker_id in ["master"]:
if (
sys.platform == "win32"
and not _default_cache_dir.joinpath(helpers.TESTDATA_BRANCH).exists()
):
raise OSError(
"UNIX-style file-locking is not supported on Windows. "
"Consider running `$ xclim prefetch_testing_data` to download testing data."
)
elif worker_id in ["master"]:
helpers.populate_testing_data(branch=helpers.TESTDATA_BRANCH)
else:
_default_cache_dir.mkdir(exist_ok=True, parents=True)
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ commands_pre =
xclim show_version_info
python -m pip check
commands =
prefetch: xclim prefetch_testing_data
doctest: pytest --no-cov --rootdir=tests/ --xdoctest xclim
pytest {posargs}
commands_post =
Expand Down

0 comments on commit 04d114c

Please sign in to comment.