From 4cece8720a6580f03a1c53a598d713e9c5d0ea58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 07:33:06 +0000 Subject: [PATCH 1/3] Bump mypy from 0.982 to 0.990 Bumps [mypy](https://github.com/python/mypy) from 0.982 to 0.990. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.982...v0.990) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index cde38e095..f4575e176 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ coveralls==3.3.1 flake8==5.0.4 flake8-tidy-imports==4.8.0 -mypy==0.982 +mypy==0.990 pre-commit==2.20.0 pytest==7.2.0 pytest-asyncio==0.20.2 From f27be7ada8c5cd16c957d1831ad85c391c85f886 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 14 Nov 2022 20:52:40 +0100 Subject: [PATCH 2/3] Configure mypy to old behavior based on https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html release --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8020b0636..2de2c957b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,8 @@ asyncio_mode = "auto" [tool.mypy] ignore_missing_imports = true +namespace_packages = false +implicit_optional = true warn_unused_ignores = true exclude = [ '^build_helpers\.py$' From 0a702cdd261e8ef3cfff1904dfe880cceba36887 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 14 Nov 2022 20:56:35 +0100 Subject: [PATCH 3/3] Ensure more methods are typechecked --- freqtrade/edge/edge_positioning.py | 4 ++-- freqtrade/freqtradebot.py | 4 ++-- freqtrade/optimize/backtesting.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freqtrade/edge/edge_positioning.py b/freqtrade/edge/edge_positioning.py index 45b4cd8f1..4656b7c93 100644 --- a/freqtrade/edge/edge_positioning.py +++ b/freqtrade/edge/edge_positioning.py @@ -392,7 +392,7 @@ class Edge: # Returning a list of pairs in order of "expectancy" return final - def _find_trades_for_stoploss_range(self, df, pair, stoploss_range): + def _find_trades_for_stoploss_range(self, df, pair: str, stoploss_range) -> list: buy_column = df['enter_long'].values sell_column = df['exit_long'].values date_column = df['date'].values @@ -407,7 +407,7 @@ class Edge: return result def _detect_next_stop_or_sell_point(self, buy_column, sell_column, date_column, - ohlc_columns, stoploss, pair): + ohlc_columns, stoploss, pair: str): """ Iterate through ohlc_columns in order to find the next trade Next trade opens from the first buy signal noticed to diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index ea7c2f1f9..2e2638126 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -354,7 +354,7 @@ class FreqtradeBot(LoggingMixin): if self.trading_mode == TradingMode.FUTURES: self._schedule.run_pending() - def update_closed_trades_without_assigned_fees(self): + def update_closed_trades_without_assigned_fees(self) -> None: """ Update closed trades without close fees assigned. Only acts when Orders are in the database, otherwise the last order-id is unknown. @@ -379,7 +379,7 @@ class FreqtradeBot(LoggingMixin): stoploss_order=order.ft_order_side == 'stoploss', send_msg=False) - trades: List[Trade] = Trade.get_open_trades_without_assigned_fees() + trades = Trade.get_open_trades_without_assigned_fees() for trade in trades: if trade.is_open and not trade.fee_updated(trade.entry_side): order = trade.select_order(trade.entry_side, False) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 3436eac44..427ad121f 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -166,7 +166,7 @@ class Backtesting: PairLocks.use_db = True Trade.use_db = True - def init_backtest_detail(self): + def init_backtest_detail(self) -> None: # Load detail timeframe if specified self.timeframe_detail = str(self.config.get('timeframe_detail', '')) if self.timeframe_detail: