Skip to content

Commit 8ecd701

Browse files
authored
Merge pull request freqtrade#11953 from freqtrade/drop_3.10
Drop support for python 3.10
2 parents f7d42ba + ac904c6 commit 8ecd701

File tree

81 files changed

+403
-428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+403
-428
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
os: [ "ubuntu-22.04", "ubuntu-24.04" ]
28-
python-version: ["3.10", "3.11", "3.12", "3.13"]
28+
python-version: ["3.11", "3.12", "3.13"]
2929

3030
steps:
3131
- uses: actions/checkout@v4
@@ -160,7 +160,7 @@ jobs:
160160
strategy:
161161
matrix:
162162
os: [ "macos-14", "macos-15" ]
163-
python-version: ["3.10", "3.11", "3.12", "3.13"]
163+
python-version: ["3.11", "3.12", "3.13"]
164164

165165
steps:
166166
- uses: actions/checkout@v4
@@ -288,7 +288,7 @@ jobs:
288288
strategy:
289289
matrix:
290290
os: [ windows-latest ]
291-
python-version: ["3.10", "3.11", "3.12", "3.13"]
291+
python-version: ["3.11", "3.12", "3.13"]
292292

293293
steps:
294294
- uses: actions/checkout@v4

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Please find the complete documentation on the [freqtrade website](https://www.fr
6464

6565
## Features
6666

67-
- [x] **Based on Python 3.10+**: For botting on any operating system - Windows, macOS and Linux.
67+
- [x] **Based on Python 3.11+**: For botting on any operating system - Windows, macOS and Linux.
6868
- [x] **Persistence**: Persistence is achieved through sqlite.
6969
- [x] **Dry-run**: Run the bot without paying money.
7070
- [x] **Backtesting**: Run a simulation of your buy/sell strategy.
@@ -219,7 +219,7 @@ To run this bot we recommend you a cloud instance with a minimum of:
219219

220220
### Software requirements
221221

222-
- [Python >= 3.10](http://docs.python-guide.org/en/latest/starting/installation/)
222+
- [Python >= 3.11](http://docs.python-guide.org/en/latest/starting/installation/)
223223
- [pip](https://pip.pypa.io/en/stable/installing/)
224224
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
225225
- [TA-Lib](https://ta-lib.github.io/ta-lib-python/)

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ To run this bot we recommend you a linux cloud instance with a minimum of:
8787

8888
Alternatively
8989

90-
- Python 3.10+
90+
- Python 3.11+
9191
- pip (pip3)
9292
- git
9393
- TA-Lib

docs/installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The easiest way to install and run Freqtrade is to clone the bot Github reposito
2424
The `stable` branch contains the code of the last release (done usually once per month on an approximately one week old snapshot of the `develop` branch to prevent packaging bugs, so potentially it's more stable).
2525

2626
!!! Note
27-
Python3.10 or higher and the corresponding `pip` are assumed to be available. The install-script will warn you and stop if that's not the case. `git` is also needed to clone the Freqtrade repository.
27+
Python3.11 or higher and the corresponding `pip` are assumed to be available. The install-script will warn you and stop if that's not the case. `git` is also needed to clone the Freqtrade repository.
2828
Also, python headers (`python<yourversion>-dev` / `python<yourversion>-devel`) must be available for the installation to complete successfully.
2929

3030
!!! Warning "Up-to-date clock"
@@ -42,7 +42,7 @@ These requirements apply to both [Script Installation](#script-installation) and
4242

4343
### Install guide
4444

45-
* [Python >= 3.10](http://docs.python-guide.org/en/latest/starting/installation/)
45+
* [Python >= 3.11](http://docs.python-guide.org/en/latest/starting/installation/)
4646
* [pip](https://pip.pypa.io/en/stable/installing/)
4747
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
4848
* [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended)
@@ -54,7 +54,7 @@ We've included/collected install instructions for Ubuntu, MacOS, and Windows. Th
5454
OS Specific steps are listed first, the common section below is necessary for all systems.
5555

5656
!!! Note
57-
Python3.10 or higher and the corresponding pip are assumed to be available.
57+
Python3.11 or higher and the corresponding pip are assumed to be available.
5858

5959
=== "Debian/Ubuntu"
6060
#### Install necessary dependencies
@@ -179,7 +179,7 @@ You can as well update, configure and reset the codebase of your bot with `./scr
179179
** --install **
180180
181181
With this option, the script will install the bot and most dependencies:
182-
You will need to have git and python3.10+ installed beforehand for this to work.
182+
You will need to have git and python3.11+ installed beforehand for this to work.
183183
184184
* Mandatory software as: `ta-lib`
185185
* Setup your virtualenv under `.venv/`

docs/windows_installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ We **strongly** recommend that Windows users use [Docker](docker_quickstart.md)
55
If that is not possible, try using the Windows Linux subsystem (WSL) - for which the Ubuntu instructions should work.
66
Otherwise, please follow the instructions below.
77

8-
All instructions assume that python 3.10+ is installed and available.
8+
All instructions assume that python 3.11+ is installed and available.
99

1010
## Clone the git repository
1111

@@ -42,7 +42,7 @@ cd freqtrade
4242

4343
Install ta-lib according to the [ta-lib documentation](https://github.com/TA-Lib/ta-lib-python#windows).
4444

45-
As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), Freqtrade provides these dependencies (in the binary wheel format) for the latest 3 Python versions (3.10, 3.11, 3.12 and 3.13) and for 64bit Windows.
45+
As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), Freqtrade provides these dependencies (in the binary wheel format) for the latest 3 Python versions (3.11, 3.12 and 3.13) and for 64bit Windows.
4646
These Wheels are also used by CI running on windows, and are therefore tested together with freqtrade.
4747

4848
Other versions must be downloaded from the above link.

freqtrade/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
__main__.py for Freqtrade
44
To launch Freqtrade as a module
55
6-
> python -m freqtrade (with Python >= 3.10)
6+
> python -m freqtrade (with Python >= 3.11)
77
"""
88

99
from freqtrade import main

freqtrade/configuration/timerange.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
import logging
66
import re
7-
from datetime import datetime, timezone
8-
9-
from typing_extensions import Self
7+
from datetime import UTC, datetime
8+
from typing import Self
109

1110
from freqtrade.constants import DATETIME_PRINT_FORMAT
1211
from freqtrade.exceptions import ConfigurationError
@@ -151,9 +150,7 @@ def parse_timerange(cls, text: str | None) -> Self:
151150
starts = rvals[index]
152151
if stype[0] == "date" and len(starts) == 8:
153152
start = int(
154-
datetime.strptime(starts, "%Y%m%d")
155-
.replace(tzinfo=timezone.utc)
156-
.timestamp()
153+
datetime.strptime(starts, "%Y%m%d").replace(tzinfo=UTC).timestamp()
157154
)
158155
elif len(starts) == 13:
159156
start = int(starts) // 1000
@@ -164,9 +161,7 @@ def parse_timerange(cls, text: str | None) -> Self:
164161
stops = rvals[index]
165162
if stype[1] == "date" and len(stops) == 8:
166163
stop = int(
167-
datetime.strptime(stops, "%Y%m%d")
168-
.replace(tzinfo=timezone.utc)
169-
.timestamp()
164+
datetime.strptime(stops, "%Y%m%d").replace(tzinfo=UTC).timestamp()
170165
)
171166
elif len(stops) == 13:
172167
stop = int(stops) // 1000

freqtrade/data/btanalysis/bt_fileutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import logging
66
import zipfile
77
from copy import copy
8-
from datetime import datetime, timezone
8+
from datetime import UTC, datetime
99
from io import BytesIO, StringIO
1010
from pathlib import Path
1111
from typing import Any, Literal
@@ -324,7 +324,7 @@ def find_existing_backtest_stats(
324324

325325
if min_backtest_date is not None:
326326
backtest_date = strategy_metadata["backtest_start_time"]
327-
backtest_date = datetime.fromtimestamp(backtest_date, tz=timezone.utc)
327+
backtest_date = datetime.fromtimestamp(backtest_date, tz=UTC)
328328
if backtest_date < min_backtest_date:
329329
# Do not use a cached result for this strategy as first result is too old.
330330
del run_ids[strategy_name]

freqtrade/data/dataprovider.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import logging
99
from collections import deque
10-
from datetime import datetime, timezone
10+
from datetime import UTC, datetime
1111
from typing import Any
1212

1313
from pandas import DataFrame, Timedelta, Timestamp, to_timedelta
@@ -98,7 +98,7 @@ def _set_cached_df(
9898
:param candle_type: Any of the enum CandleType (must match trading mode!)
9999
"""
100100
pair_key = (pair, timeframe, candle_type)
101-
self.__cached_pairs[pair_key] = (dataframe, datetime.now(timezone.utc))
101+
self.__cached_pairs[pair_key] = (dataframe, datetime.now(UTC))
102102

103103
# For multiple producers we will want to merge the pairlists instead of overwriting
104104
def _set_producer_pairs(self, pairlist: list[str], producer_name: str = "default"):
@@ -131,7 +131,7 @@ def _emit_df(self, pair_key: PairWithTimeframe, dataframe: DataFrame, new_candle
131131
"data": {
132132
"key": pair_key,
133133
"df": dataframe.tail(1),
134-
"la": datetime.now(timezone.utc),
134+
"la": datetime.now(UTC),
135135
},
136136
}
137137
self.__rpc.send_msg(msg)
@@ -164,7 +164,7 @@ def _replace_external_df(
164164
if producer_name not in self.__producer_pairs_df:
165165
self.__producer_pairs_df[producer_name] = {}
166166

167-
_last_analyzed = datetime.now(timezone.utc) if not last_analyzed else last_analyzed
167+
_last_analyzed = datetime.now(UTC) if not last_analyzed else last_analyzed
168168

169169
self.__producer_pairs_df[producer_name][pair_key] = (dataframe, _last_analyzed)
170170
logger.debug(f"External DataFrame for {pair_key} from {producer_name} added.")
@@ -275,12 +275,12 @@ def get_producer_df(
275275
# If we have no data from this Producer yet
276276
if producer_name not in self.__producer_pairs_df:
277277
# We don't have this data yet, return empty DataFrame and datetime (01-01-1970)
278-
return (DataFrame(), datetime.fromtimestamp(0, tz=timezone.utc))
278+
return (DataFrame(), datetime.fromtimestamp(0, tz=UTC))
279279

280280
# If we do have data from that Producer, but no data on this pair_key
281281
if pair_key not in self.__producer_pairs_df[producer_name]:
282282
# We don't have this data yet, return empty DataFrame and datetime (01-01-1970)
283-
return (DataFrame(), datetime.fromtimestamp(0, tz=timezone.utc))
283+
return (DataFrame(), datetime.fromtimestamp(0, tz=UTC))
284284

285285
# We have it, return this data
286286
df, la = self.__producer_pairs_df[producer_name][pair_key]
@@ -396,10 +396,10 @@ def get_analyzed_dataframe(self, pair: str, timeframe: str) -> tuple[DataFrame,
396396
if (max_index := self.__slice_index.get(pair)) is not None:
397397
df = df.iloc[max(0, max_index - MAX_DATAFRAME_CANDLES) : max_index]
398398
else:
399-
return (DataFrame(), datetime.fromtimestamp(0, tz=timezone.utc))
399+
return (DataFrame(), datetime.fromtimestamp(0, tz=UTC))
400400
return df, date
401401
else:
402-
return (DataFrame(), datetime.fromtimestamp(0, tz=timezone.utc))
402+
return (DataFrame(), datetime.fromtimestamp(0, tz=UTC))
403403

404404
@property
405405
def runmode(self) -> RunMode:

freqtrade/data/history/datahandlers/idatahandler.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import re
99
from abc import ABC, abstractmethod
1010
from copy import deepcopy
11-
from datetime import datetime, timezone
11+
from datetime import UTC, datetime
1212
from pathlib import Path
1313

1414
from pandas import DataFrame, to_datetime
@@ -118,8 +118,8 @@ def ohlcv_data_min_max(
118118
df = self._ohlcv_load(pair, timeframe, None, candle_type)
119119
if df.empty:
120120
return (
121-
datetime.fromtimestamp(0, tz=timezone.utc),
122-
datetime.fromtimestamp(0, tz=timezone.utc),
121+
datetime.fromtimestamp(0, tz=UTC),
122+
datetime.fromtimestamp(0, tz=UTC),
123123
0,
124124
)
125125
return df.iloc[0]["date"].to_pydatetime(), df.iloc[-1]["date"].to_pydatetime(), len(df)
@@ -201,8 +201,8 @@ def trades_data_min_max(
201201
df = self._trades_load(pair, trading_mode)
202202
if df.empty:
203203
return (
204-
datetime.fromtimestamp(0, tz=timezone.utc),
205-
datetime.fromtimestamp(0, tz=timezone.utc),
204+
datetime.fromtimestamp(0, tz=UTC),
205+
datetime.fromtimestamp(0, tz=UTC),
206206
0,
207207
)
208208
return (

0 commit comments

Comments
 (0)