Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.8 from workflows, run on 3.11 #3228

Merged
merged 8 commits into from
Nov 5, 2024
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
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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import above can raise OSError as well, so I'm catching that too to turn off mx

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
)
Comment on lines -23 to -25
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.11 would complain here, that the default value in a dataclass cannot be mutable

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪄

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