diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c568e9b5d1..5ae14945be3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: - repo: https://github.com/charliermarsh/ruff-pre-commit # Ruff version. - rev: 'v0.15.21' + rev: 'v0.15.22' hooks: - id: ruff - id: ruff-format @@ -62,7 +62,7 @@ repos: - id: strip-exif - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell additional_dependencies: @@ -70,6 +70,6 @@ repos: # Ensure github actions remain safe - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.26.1 + rev: v1.27.0 hooks: - id: zizmor diff --git a/freqtrade/vendor/qtpylib/indicators.py b/freqtrade/vendor/qtpylib/indicators.py index ff3f3a5fafa..4088292f2e6 100644 --- a/freqtrade/vendor/qtpylib/indicators.py +++ b/freqtrade/vendor/qtpylib/indicators.py @@ -3,7 +3,7 @@ # the one shipped by technical, so we re-export from there to avoid maintaining a # duplicate. Existing imports such as # `from freqtrade.vendor.qtpylib.indicators import crossed_above` keep working, -# but emit a DeprecationWarning pointing at technical. +# but emit a FutureWarning pointing at technical. import warnings @@ -15,6 +15,6 @@ "release. Import from technical instead - either the module " "(`from technical import qtpylib`) or a single " "function (`from technical.qtpylib import crossed_above`).", - DeprecationWarning, + FutureWarning, stacklevel=2, ) diff --git a/tests/test_indicators.py b/tests/test_indicators.py index b433b5dedc7..26e7b4d96fa 100644 --- a/tests/test_indicators.py +++ b/tests/test_indicators.py @@ -15,9 +15,9 @@ def test_crossed_numpy_types(): expected_result = pd.Series([False, True, False, True, False, False, True, False, False, False]) # freqtrade.vendor.qtpylib is a deprecated shim around technical and emits a - # DeprecationWarning on import - suppress it here, it's asserted below. + # FutureWarning on import - suppress it here, it's asserted below. with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) + warnings.simplefilter("ignore", FutureWarning) import freqtrade.vendor.qtpylib.indicators as qtpylib assert qtpylib.crossed_above(series, 60).equals(expected_result) @@ -27,11 +27,12 @@ def test_crossed_numpy_types(): assert qtpylib.crossed_above(series, np.float64(60.0)).equals(expected_result) +@pytest.mark.filterwarnings("ignore:freqtrade.vendor.qtpylib.indicators' is deprecated") def test_qtpylib_deprecation(): """freqtrade.vendor.qtpylib.indicators only re-exports technical now and is deprecated.""" - import freqtrade.vendor.qtpylib.indicators as qtpylib + with warnings.catch_warnings(): + warnings.simplefilter("ignore", FutureWarning) + import freqtrade.vendor.qtpylib.indicators as qtpylib - with pytest.warns( - DeprecationWarning, match="freqtrade.vendor.qtpylib.indicators' is deprecated" - ): + with pytest.warns(FutureWarning, match="freqtrade.vendor.qtpylib.indicators' is deprecated"): importlib.reload(qtpylib)