From 7f3668d1402d2329e0fccb55609c4aaa61193c89 Mon Sep 17 00:00:00 2001
From: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Date: Mon, 8 Jul 2024 03:53:37 +0100
Subject: [PATCH] Support and test with py3.11 (#619)

- update scikit-learn dependency to support python 3.11
---
 .github/workflows/ci.yml |  2 +-
 pyproject.toml           | 17 +++++++++++++----
 setup.cfg                |  2 +-
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ab5662b2d..2214f75b6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -82,7 +82,7 @@ jobs:
 
         strategy:
             matrix:
-                python-version: ['3.9', '3.10']
+                python-version: ['3.9', '3.11']
                 # Test on the latest and oldest supported version
                 aiida-core-version: [2.2.2, 2.4.3]
             fail-fast: false
diff --git a/pyproject.toml b/pyproject.toml
index 3126edfcc..fad086a2a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,8 +7,16 @@ build-backend = "setuptools.build_meta"
 
 [tool.pytest.ini_options]
 filterwarnings = [
-    'error',
-    'ignore::DeprecationWarning:bokeh.core.property.primitive',
+    # The following deprecation warnings come from Python 3.12 stdlib modules
+    "ignore:datetime.datetime.:DeprecationWarning:",
+    # This one is coming from plumpy
+    "ignore:There is no current event loop:DeprecationWarning:",
+    # This deprecation warning coming from sqlite3 module might go away if we update bokeh
+    "ignore:The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes:DeprecationWarning:",
+    # This is needed since SQLAlchemy 2.0, see
+    # https://github.com/aiidalab/aiidalab-widgets-base/issues/605
+    'ignore:Object of type .* not in session, .* operation along .* will not proceed:sqlalchemy.exc.SAWarning',
+    'ignore::DeprecationWarning:bokeh',
     'ignore:Creating AiiDA configuration:UserWarning:aiida',
     'ignore:crystal system:UserWarning:ase.io.cif',
     'ignore::DeprecationWarning:ase.atoms',
@@ -22,8 +30,9 @@ filterwarnings = [
     'ignore:Exception ignored in:pytest.PytestUnraisableExceptionWarning:_pytest',
     'ignore::DeprecationWarning:pytest_html',
     'ignore::DeprecationWarning:jupyter_client',
-    'ignore::DeprecationWarning:selenium',
-    'ignore::DeprecationWarning:pytest_selenium',
+    # This warning is coming from circus (aiida-core dependency):
+    # https://github.com/circus-tent/circus/issues/1215
+    "ignore:'pipes' is deprecated and slated for removal in Python 3.13:DeprecationWarning:",
 ]
 
 [tool.ruff]
diff --git a/setup.cfg b/setup.cfg
index d64495505..8552ea497 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -60,7 +60,7 @@ optimade =
     ipyoptimade~=0.1
 smiles =
     rdkit>=2021.09.2
-    scikit-learn~=1.0.0
+    scikit-learn~=1.1
 docs =
     sphinx
     sphinx-design