From a9ba3507711c3752fc973d28cd5f67d2b91476ba Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Wed, 30 Oct 2024 08:47:18 +0100 Subject: [PATCH 1/3] rf: homogenize deprecation pattern for `datalad_next.iterools` with those of other modules, like `datalad_next.gitpathspec`. --- datalad_next/itertools/__init__.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/datalad_next/itertools/__init__.py b/datalad_next/itertools/__init__.py index f2ddf002..cef78546 100644 --- a/datalad_next/itertools/__init__.py +++ b/datalad_next/itertools/__init__.py @@ -1,9 +1,9 @@ """Various iterators, e.g., for subprocess pipelining and output processing .. deprecated:: 1.6 - - This code has been moved to the datasalad library. - Use it from ``datasalad.itertools`` instead. + This module is deprecated. It has been migrated to the `datasalad library + `__. Imports should be adjusted to + ``datasalad.itertools``. """ __all__ = [ @@ -17,7 +17,10 @@ 'route_out', ] +import warnings + from datasalad.itertools import ( + StoreOnly, align_pattern, decode_bytes, itemize, @@ -25,5 +28,11 @@ load_json_with_flag, route_in, route_out, - StoreOnly, +) + +warnings.warn( + '`datalad_next.itertools` has been migrated to the datasalad library, ' + 'adjust imports to `datasalad.itertools`', + DeprecationWarning, + stacklevel=1, ) From 5961e47c017d6d6e7eb4cbe3c9c896fe514bae46 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Wed, 30 Oct 2024 08:53:29 +0100 Subject: [PATCH 2/3] rf: homogenize deprecation pattern for `datalad_next.iterable_subprocess` with those of other modules, like `datalad_next.gitpathspec`. --- datalad_next/iterable_subprocess/__init__.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/datalad_next/iterable_subprocess/__init__.py b/datalad_next/iterable_subprocess/__init__.py index 48ea6080..d68881a4 100644 --- a/datalad_next/iterable_subprocess/__init__.py +++ b/datalad_next/iterable_subprocess/__init__.py @@ -1,9 +1,9 @@ """Context manager to communicate with a subprocess using iterables .. deprecated:: 1.6 - - This code has been moved to the datasalad library. - Use it from ``datasalad.iterable_subprocess`` instead. + This module is deprecated. It has been migrated to the `datasalad library + `__. Imports should be adjusted to + ``datasalad.iterable_subprocess``. This offers a higher level interface to subprocesses than Python's built-in subprocess module, and is particularly helpful when data won't fit in memory @@ -22,4 +22,13 @@ __all__ = ['iterable_subprocess'] +import warnings + from datasalad.iterable_subprocess import iterable_subprocess + +warnings.warn( + '`datalad_next.iterable_subprocess` has been migrated to the datasalad ' + 'library, adjust imports to `datasalad.iterable_subprocess`', + DeprecationWarning, + stacklevel=1, +) From b636124c0881f21dc1dfae2911bdfc517e67df58 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Wed, 30 Oct 2024 08:56:38 +0100 Subject: [PATCH 3/3] rf: import `PRE_INIT_COMMIT_SHA` from `datalad_core` In an effort to trim dependencies on legacy datalad. --- datalad_next/consts/__init__.py | 9 ++++++++- pyproject.toml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/datalad_next/consts/__init__.py b/datalad_next/consts/__init__.py index 2d2e4876..b847d50e 100644 --- a/datalad_next/consts/__init__.py +++ b/datalad_next/consts/__init__.py @@ -16,6 +16,13 @@ ``True`` if executed on the Windows platform. """ +__all__ = [ + 'COPY_BUFSIZE', + 'PRE_INIT_COMMIT_SHA', + 'on_linux', + 'on_windows', +] + # import from "utils", but these really are constants from datalad.utils import ( on_linux, @@ -29,4 +36,4 @@ # from PY3.10 COPY_BUFSIZE = 1024 * 1024 if on_windows else 64 * 1024 -from datalad.consts import PRE_INIT_COMMIT_SHA +from datalad_core.consts import PRE_INIT_COMMIT_SHA diff --git a/pyproject.toml b/pyproject.toml index c7310b97..89da4513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ classifiers = [ dependencies = [ "annexremote", "datalad >= 0.18.4", + "datalad-core", "datasalad >= 0.5.0", "humanize", "more-itertools",