From edc1d1e0a7e276a96f9a4461a4c402e54ae1a0f5 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:56:35 -0400 Subject: [PATCH 1/3] generate a cache dir even if .cache is not found --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 29a40899a..f5c1f5301 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -450,7 +450,7 @@ def gather_session_data(threadsafe_data_dir, worker_id, xdoctest_namespace): if worker_id in "master": helpers.populate_testing_data(branch=helpers.TESTDATA_BRANCH) else: - _default_cache_dir.mkdir(exist_ok=True) + _default_cache_dir.mkdir(exist_ok=True, parents=True) test_data_being_written = FileLock(_default_cache_dir.joinpath(".lock")) with test_data_being_written as fl: # This flag prevents multiple calls from re-attempting to download testing data in the same pytest run From 33c70f913486c2e5e137d6018c13f671caa4e78f Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:01:45 -0400 Subject: [PATCH 2/3] update changes.rst, double-check that _get supports mkdir(parents=True) --- CHANGES.rst | 1 + xclim/testing/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8bdb893f5..b307c4ae0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -21,6 +21,7 @@ Bug fixes * Calling a ``sdba.map_blocks``-wrapped function with data chunked along the reduced dimensions will raise an error. This forbids chunking the trained dataset along the distribution dimensions, for example. (:issue:`1481`, :pull:`1482`). * Optimization of indicators ``huglin_index`` and ``biologically_effective_degree_days`` when used with dask and flox. As a side effect, the indice functions (i.e. under ``xc.indices``) no longer mask incomplete periods. The indicators' output is unchanged under the default "check_missing" setting (:issue:`1494`, :pull:`1495`). * Fixed ``xclim.indices.run_length.lazy_indexing`` which would sometimes trigger the loading of auxiliary coordinates. (:issue:`1483`, :pull:`1484`). +* Fixed a bug in the `pytest` configuration that could prevent testing data caching from occurring in systems where the platform-dependent cache directory is not found in the user's home. (:issue:`1468`, :pull:`1473`). Breaking changes ^^^^^^^^^^^^^^^^ diff --git a/xclim/testing/utils.py b/xclim/testing/utils.py index ecd202c51..b4ca456eb 100644 --- a/xclim/testing/utils.py +++ b/xclim/testing/utils.py @@ -232,7 +232,7 @@ def _get( if not local_file.is_file(): # This will always leave this directory on disk. # We may want to add an option to remove it. - local_file.parent.mkdir(parents=True, exist_ok=True) + local_file.parent.mkdir(exist_ok=True, parents=True) url = "/".join((github_url, "raw", branch, fullname.as_posix())) logger.info(f"Fetching remote file: {fullname.as_posix()}") From 34fb116d03475ad77800d5194f1806b8658854ea Mon Sep 17 00:00:00 2001 From: "bumpversion[bot]" Date: Fri, 13 Oct 2023 15:48:40 +0000 Subject: [PATCH 3/3] =?UTF-8?q?Bump=20version:=200.45.11-beta=20=E2=86=92?= =?UTF-8?q?=200.45.12-beta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.cfg | 2 +- xclim/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 04ac2d1dd..e153a6d6a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.45.11-beta +current_version = 0.45.12-beta commit = True tag = False parse = (?P\d+)\.(?P\d+).(?P\d+)(\-(?P[a-z]+))? diff --git a/xclim/__init__.py b/xclim/__init__.py index 07780edfd..ab46067ed 100644 --- a/xclim/__init__.py +++ b/xclim/__init__.py @@ -11,7 +11,7 @@ __author__ = """Travis Logan""" __email__ = "logan.travis@ouranos.ca" -__version__ = "0.45.11-beta" +__version__ = "0.45.12-beta" # Load official locales