Skip to content

Commit

Permalink
Require and test python >=3.10 according to NEP 29 (#1379)
Browse files Browse the repository at this point in the history
* Update setup.cfg

Remove python 3.9

* Update ci.yml

Remove python 3.9 and update to 3.11

* Update deploy.yml

Change python 3.9 by 3.11

* Update ci.yml

Add python 3.10

* Update setup.cfg

Add python 3.12

* Update ci.yml

Update from python 3.11 to 3.12

* Update deploy.yml

Update from python 3.11 to 3.12

* Skip aesara tests on case of python >= 3.12 and use 3.11 for building the documentation.

* Update test/base/test_objective.py

Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>

* Update .github/workflows/ci.yml

---------

Co-authored-by: PaulJonasJost <jost.pauljonas@gmail.com>
Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
  • Loading branch information
3 people authored May 3, 2024
1 parent e197a8b commit fc7b615
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.11']
python-version: ['3.10', '3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.11']
python-version: ['3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.11']
python-version: ['3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.11']
python-version: ['3.10', '3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.11']
python-version: ['3.10', '3.12']

# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
Expand Down Expand Up @@ -225,8 +225,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# ipopt does not work on 3.9 (https://github.com/mechmotum/cyipopt/issues/225)
python-version: ['3.11']
python-version: ['3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -262,7 +261,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.11']
python-version: ['3.10', '3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -298,7 +297,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.11']
python-version: ['3.10', '3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -334,7 +333,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
python-version: ['3.12']

steps:
- name: Check out repository
Expand Down Expand Up @@ -399,7 +398,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9']
python-version: ['3.10']

steps:
- name: Check out repository
Expand Down Expand Up @@ -429,7 +428,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9']
python-version: ['3.10']

steps:
- name: Check out repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9']
python-version: ['3.12']

steps:
- name: Check out repository
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ classifiers =
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.9
keywords =
parameter inference
optimization
Expand All @@ -58,7 +58,7 @@ install_requires =
tqdm >= 4.46.0
tabulate >= 0.8.10

python_requires = >=3.9
python_requires = >=3.10
include_package_data = True

# Where is my code
Expand Down
7 changes: 7 additions & 0 deletions test/base/test_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import copy
import numbers
import sys
from functools import partial

import numpy as np
Expand All @@ -12,6 +13,11 @@

from ..util import CRProblem, poly_for_sensi, rosen_for_sensi

pytest_skip_aesara = pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Skipped Aesara tests on Python 3.12 or higher",
)


@pytest.fixture(params=[True, False])
def integrated(request):
Expand Down Expand Up @@ -178,6 +184,7 @@ def rel_err(eps_):
)


@pytest_skip_aesara
def test_aesara(max_sensi_order, integrated):
"""Test function composition and gradient computation via aesara"""
import aesara.tensor as aet
Expand Down

0 comments on commit fc7b615

Please sign in to comment.