Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -62,14 +62,14 @@ repos:
- id: strip-exif

- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell
additional_dependencies:
- tomli

# Ensure github actions remain safe
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.26.1
rev: v1.27.0
hooks:
- id: zizmor
4 changes: 2 additions & 2 deletions freqtrade/vendor/qtpylib/indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
)
13 changes: 7 additions & 6 deletions tests/test_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Loading