From 493e130c846d38e4eb7dc47d9bd05bed6edc09c1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 22:08:02 -0800 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate (#1239) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.2 → v0.9.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.2...v0.9.6) - [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.3.0...v2.4.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80e876a58..8b1d006fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # hooks: # - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.2 + rev: v0.9.6 hooks: - id: ruff # - repo: https://github.com/econchick/interrogate @@ -26,7 +26,7 @@ repos: # hooks: # - id: interrogate - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.1 hooks: - id: codespell additional_dependencies: From 4d42540ad850ed13b915ec72a9ffc421023c9783 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Sun, 16 Feb 2025 10:46:17 -0800 Subject: [PATCH 2/2] Deprecate monitor.py (#1245) * Add DeprecationWarning to monitor.py * Fix syntax * Add warning test * Update changelog --- CHANGELOG.md | 5 +++++ src/hdmf/monitor.py | 8 ++++++++ tests/unit/test_monitor.py | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 tests/unit/test_monitor.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e3f480c8..4462ff604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # HDMF Changelog +## [Unreleased] + +### Changed +- `hdmf.monitor` is unused and undocumented. It has been deprecated and will be removed in HDMF 5.0. @rly [#1245](https://github.com/hdmf-dev/hdmf/pull/1245) + ## HDMF 4.0.0 (January 22, 2025) ### Breaking changes diff --git a/src/hdmf/monitor.py b/src/hdmf/monitor.py index 823ccf72d..9f8e7e0cc 100644 --- a/src/hdmf/monitor.py +++ b/src/hdmf/monitor.py @@ -1,8 +1,16 @@ from abc import ABCMeta, abstractmethod +import warnings from .data_utils import AbstractDataChunkIterator, DataChunkIterator, DataChunk from .utils import docval, getargs +warnings.warn( + "The hdmf.monitor module is deprecated and will be removed in HDMF 5.0. If you are using this module, " + "please copy this module to your codebase or raise an issue in the HDMF repository: " + "https://github.com/hdmf-dev/hdmf/issues", + DeprecationWarning, +) + class NotYetExhausted(Exception): pass diff --git a/tests/unit/test_monitor.py b/tests/unit/test_monitor.py new file mode 100644 index 000000000..f9af06a9c --- /dev/null +++ b/tests/unit/test_monitor.py @@ -0,0 +1,6 @@ +import pytest + + +def test_deprecation_warning(): + with pytest.warns(DeprecationWarning): + import hdmf.monitor # noqa: F401