Skip to content

Commit

Permalink
Drop Python 3.8 from workflows, run on 3.11 (#3228)
Browse files Browse the repository at this point in the history
*Issue #, if available:* Python 3.8 reached EOL, and some packages are
not distributed for it in their latest versions.

*Description of changes:*
- update github workflows to run on Python (up to) 3.11
- fix tests and testutils that would break on 3.11
- delete some unused workflows
- update sphinx version used in the docs build workflow


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.


**Please tag this pr with at least one of these labels to make our
release process faster:** BREAKING, new feature, bug fix, other change,
dev setup
  • Loading branch information
lostella authored Nov 5, 2024
1 parent 3d05d46 commit bb31530
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 152 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11

- name: Install dependencies
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/doctests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install tools
run: pip install "ruff==0.2.2" "docformatter[tomli]==1.5.0"
- name: Ruff (Flake8)
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/mxnet_nightly.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ jobs:
- uses: actions/checkout@v4
- name: Get tags
run: git fetch --tags origin
- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install -U pip
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/style_type_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install .
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/test_release_unix_nightly.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/test_release_win32_nightly.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/tests-nixtla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests-nursery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 1
fail-fast: false
matrix:
python-version: ['3.8']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand All @@ -17,8 +17,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install MXNet (Linux)
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests-prophet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests-r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand All @@ -32,8 +32,7 @@ jobs:
libxml2-dev \
libcurl4-openssl-dev
Rscript -e 'install.packages(c("forecast", "nnfor", "hts"), repos="https://cloud.r-project.org")'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-torch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-xgboost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install other dependencies
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ notedown
lxml~=5.1.0
pytest-runner~=2.11
recommonmark
sphinx~=4.0
sphinx~=5.0
docutils<=0.16
optuna~=2.10
furo==2022.6.4.1
Expand Down
4 changes: 2 additions & 2 deletions src/gluonts/testutil/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import typing
import waitress
from contextlib import closing, contextmanager
from dataclasses import dataclass
from dataclasses import dataclass, field
from multiprocessing.context import ForkContext
from pathlib import Path
from typing import Any, ContextManager, Dict, Iterable, List, Optional, Type
Expand Down Expand Up @@ -119,7 +119,7 @@ def free_port() -> int:
class Server:
env: ServeEnv
forecaster_type: Optional[Type[Predictor]]
settings: Settings = Settings()
settings: Settings = field(default_factory=Settings)

def run(self):
flask_app = make_flask_app(
Expand Down
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

try:
import mxnet as mx
except ImportError:
except (ImportError, OSError):
mx = None

try:
Expand Down
7 changes: 3 additions & 4 deletions test/core/test_serde_dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
@serde.dataclass
class Estimator:
prediction_length: int
context_length: int = serde.OrElse(
lambda prediction_length: prediction_length * 2
)
context_length: int = serde.EVENTUAL

use_feat_static_cat: bool = True
cardinality: List[int] = serde.EVENTUAL

def __eventually__(self, cardinality):
def __eventually__(self, context_length, cardinality):
context_length.set_default(self.prediction_length * 2)
if not self.use_feat_static_cat:
cardinality.set([1])
else:
Expand Down

0 comments on commit bb31530

Please sign in to comment.