From a3c1a1e7a39bd3cde4f0fffcc93a3ab2b94b599f Mon Sep 17 00:00:00 2001 From: dennisbader Date: Wed, 6 Nov 2024 17:55:12 +0100 Subject: [PATCH 1/4] bump minimum python version from 3.8 to 3.9 --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .github/workflows/develop.yml | 14 +++++++------- .github/workflows/doc.yml | 4 ++-- .github/workflows/merge.yml | 14 +++++++------- .github/workflows/release.yml | 8 ++++---- .github/workflows/update-cache.yml | 2 +- README.md | 4 ++-- conda_recipe/environment.yml | 2 +- .../utils/tabularization/test_get_shared_times.py | 10 +--------- darts/utils/utils.py | 2 +- requirements/core.txt | 3 +-- setup.py | 4 ++-- setup_u8darts.py | 4 ++-- 13 files changed, 33 insertions(+), 42 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 4692b54e67..47a1e330bf 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -17,8 +17,8 @@ Steps to reproduce the behavior, preferably code snippet. A clear and concise description of what you expected to happen. **System (please complete the following information):** - - Python version: [e.g. 3.8] - - darts version [e.g. 0.24.0] + - Python version: [e.g. 3.10] + - darts version [e.g. 0.31.0] **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 4cbda231bd..96d659ee17 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -12,10 +12,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.9" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' - name: "Install Dev Dependencies" run: | @@ -32,7 +32,7 @@ jobs: strategy: matrix: os: [macos-13, ubuntu-latest] - python-version: ['3.9'] + python-version: ['3.10'] flavour: ['all'] steps: @@ -87,10 +87,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.9" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' # use `uv` to retrieve the latest dependency versions - name: "Compile Dependency Versions" @@ -140,10 +140,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.9" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' # use `uv` to retrieve the latest dependency versions - name: "Compile Dependency Versions" diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 9c55ceeac4..3e9a56472f 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -10,10 +10,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.9" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' # use `uv` to retrieve the latest dependency versions - name: "Compile Dependency Versions" diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index d19360c0ea..e3dd873956 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -12,10 +12,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.10" + - name: "Set up Python 3.11" uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: "Install Dev Dependencies" run: | @@ -31,7 +31,7 @@ jobs: strategy: matrix: os: [macos-13, ubuntu-latest] - python-version: ['3.8', '3.10'] + python-version: ['3.9', '3.11'] flavour: ['core', 'torch', 'all'] steps: @@ -85,10 +85,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.9" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' # use `uv` to retrieve the latest dependency versions - name: "Compile Dependency Versions" @@ -132,10 +132,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.9" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' # use `uv` to retrieve the latest dependency versions - name: "Compile Dependency Versions" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a7ffac811..ac451a8c74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,10 +17,10 @@ jobs: token: ${{ secrets.RELEASE_WORKFLOW_TOKEN_NEW_FINE_GRAINED }} fetch-depth: '1' - - name: "2. Set up Python 3.9" + - name: "2. Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' - name: "Setup Pip" run: | @@ -108,10 +108,10 @@ jobs: - name: "Clone repository" uses: actions/checkout@v4 - - name: "Set up Python 3.9" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' # use `uv` to retrieve the latest dependency versions - name: "Compile Dependency Versions" diff --git a/.github/workflows/update-cache.yml b/.github/workflows/update-cache.yml index f49bb76132..978f6ab4d8 100644 --- a/.github/workflows/update-cache.yml +++ b/.github/workflows/update-cache.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [macos-13, ubuntu-latest] - python-version: ['3.9'] + python-version: ['3.10'] flavour: ['all'] steps: diff --git a/README.md b/README.md index bd3f6198d8..c87c8c3e35 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ --- [![PyPI version](https://badge.fury.io/py/u8darts.svg)](https://badge.fury.io/py/darts) [![Conda Version](https://img.shields.io/conda/vn/conda-forge/u8darts-all.svg)](https://anaconda.org/conda-forge/u8darts-all) -![Supported versions](https://img.shields.io/badge/python-3.8+-blue.svg) +![Supported versions](https://img.shields.io/badge/python-3.9+-blue.svg) [![Docker Image Version (latest by date)](https://img.shields.io/docker/v/unit8/darts?label=docker&sort=date)](https://hub.docker.com/r/unit8/darts) ![GitHub Release Date](https://img.shields.io/github/release-date/unit8co/darts) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/unit8co/darts/release.yml?branch=master) @@ -50,7 +50,7 @@ fledged anomaly detection models. ## Quick Install -We recommend to first setup a clean Python environment for your project with Python 3.8+ using your favorite tool +We recommend to first setup a clean Python environment for your project with Python 3.9+ using your favorite tool ([conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html "conda-env"), [venv](https://docs.python.org/3/library/venv.html), [virtualenv](https://virtualenv.pypa.io/en/latest/) with or without [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/)). diff --git a/conda_recipe/environment.yml b/conda_recipe/environment.yml index 98005d0d18..f8579619ac 100644 --- a/conda_recipe/environment.yml +++ b/conda_recipe/environment.yml @@ -1,6 +1,6 @@ # conda-specific dependencies for the dev environment name: darts-dev dependencies: - - python>=3.8 + - python>=3.9 - conda-build - conda-verify diff --git a/darts/tests/utils/tabularization/test_get_shared_times.py b/darts/tests/utils/tabularization/test_get_shared_times.py index 147b77ec75..dab53a8092 100644 --- a/darts/tests/utils/tabularization/test_get_shared_times.py +++ b/darts/tests/utils/tabularization/test_get_shared_times.py @@ -1,4 +1,4 @@ -from math import gcd +from math import lcm import pandas as pd import pytest @@ -7,14 +7,6 @@ from darts.utils.timeseries_generation import linear_timeseries -# math.lcm is not available in Python <= 3.8, so we define it here -def lcm(*integers): - a = integers[0] - for b in integers[1:]: - a = (a * b) // gcd(a, b) - return a - - class TestGetSharedTimes: """ Tests `get_shared_times` function defined in `darts.utils.data.tabularization`. diff --git a/darts/utils/utils.py b/darts/utils/utils.py index c7c2480215..3a5e6297c0 100644 --- a/darts/utils/utils.py +++ b/darts/utils/utils.py @@ -43,7 +43,7 @@ class ModelMode(Enum): NONE = None -# TODO: remove this once bumping min python version from 3.8 to 3.9 (pandas v2.2.0 not available for p38) +# TODO: remove this at some point when we set a lower cap on pandas v2.2.0 pd_above_v22 = pd.__version__ >= "2.2" freqs = { "YE": "YE" if pd_above_v22 else "A", diff --git a/requirements/core.txt b/requirements/core.txt index 42ba2ae1d6..0245c46194 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -3,8 +3,7 @@ joblib>=0.16.0 matplotlib>=3.3.0 nfoursid>=1.0.0 numpy>=1.19.0,<2.0.0 -pandas>=1.0.5,<2.0.0; python_version < "3.9" -pandas>=1.0.5; python_version >= "3.9" +pandas>=1.0.5 pmdarima>=1.8.0 pyod>=0.9.5 requests>=2.22.0 diff --git a/setup.py b/setup.py index eae054308b..50f87db91d 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ def read_requirements(path): "darts": ["py.typed"], }, zip_safe=False, - python_requires=">=3.8", + python_requires=">=3.9", classifiers=[ "Intended Audience :: Science/Research", "Intended Audience :: Developers", @@ -57,9 +57,9 @@ def read_requirements(path): "Operating System :: Unix", "Operating System :: MacOS", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: PyPy", ], keywords="time series forecasting", diff --git a/setup_u8darts.py b/setup_u8darts.py index 453fa343f4..0a084f1be3 100644 --- a/setup_u8darts.py +++ b/setup_u8darts.py @@ -45,7 +45,7 @@ def read_requirements(path): "darts": ["py.typed"], }, zip_safe=False, - python_requires=">=3.8", + python_requires=">=3.9", classifiers=[ "Intended Audience :: Science/Research", "Intended Audience :: Developers", @@ -57,9 +57,9 @@ def read_requirements(path): "Operating System :: Unix", "Operating System :: MacOS", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: PyPy", ], keywords="time series forecasting", From 69f5d18fc7ef628acd5a366826250b3b42b00a1f Mon Sep 17 00:00:00 2001 From: dennisbader Date: Wed, 6 Nov 2024 17:59:24 +0100 Subject: [PATCH 2/4] remove last gradle file --- settings.gradle | 1 - 1 file changed, 1 deletion(-) delete mode 100644 settings.gradle diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 7001fe30f3..0000000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'darts' From 5fa7fb56998d722977dfd1c3dcaa68ae69d32de8 Mon Sep 17 00:00:00 2001 From: dennisbader Date: Thu, 7 Nov 2024 09:38:52 +0100 Subject: [PATCH 3/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21256695db..eb9debad71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ but cannot always guarantee backwards compatibility. Changes that may **break co - Fixed a bug when using `darts.utils.data.tabularization.create_lagged_component_names()` with target `lags=None`, that did not return any lagged target label component names. [#2576](https://github.com/unit8co/darts/pull/2576) by [Dennis Bader](https://github.com/dennisbader). **Dependencies** +- 🔴 Removed support for Python 3.8. The new minimum Python version is 3.9. [#2586](https://github.com/unit8co/darts/pull/2586) by [Dennis Bader](https://github.com/dennisbader). ### For developers of the library: From 0dd6b52e1bca21dd0aa1ce1d356dd52d91c5fd58 Mon Sep 17 00:00:00 2001 From: dennisbader Date: Thu, 7 Nov 2024 09:39:15 +0100 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb9debad71..dc9b945be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ but cannot always guarantee backwards compatibility. Changes that may **break co - Fixed a bug when using `darts.utils.data.tabularization.create_lagged_component_names()` with target `lags=None`, that did not return any lagged target label component names. [#2576](https://github.com/unit8co/darts/pull/2576) by [Dennis Bader](https://github.com/dennisbader). **Dependencies** + - 🔴 Removed support for Python 3.8. The new minimum Python version is 3.9. [#2586](https://github.com/unit8co/darts/pull/2586) by [Dennis Bader](https://github.com/dennisbader). ### For developers of the library: