From fbc4974cf59165c00d5cbbd5466e320f0605df62 Mon Sep 17 00:00:00 2001 From: MaximeLecardonnel6x7 Date: Fri, 15 Mar 2024 09:57:35 +0100 Subject: [PATCH 1/3] Drop python 3.8 and addition of python 3.12. --- README.md | 2 +- docs/installation-instructions/index.rst | 2 +- setup.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aee9e717..63503766 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Shapash can use category-encoders object, sklearn ColumnTransformer or simply fe ## 🛠 Installation -Shapash is intended to work with Python versions 3.8 to 3.11. Installation can be done with pip: +Shapash is intended to work with Python versions 3.9 to 3.12. Installation can be done with pip: ```bash pip install shapash diff --git a/docs/installation-instructions/index.rst b/docs/installation-instructions/index.rst index e4768430..d1143ac5 100644 --- a/docs/installation-instructions/index.rst +++ b/docs/installation-instructions/index.rst @@ -4,7 +4,7 @@ Installation instructions Installing ---------- -**Shapash** is intended to work with Python versions 3.8 to 3.11. Installation can be done with pip: +**Shapash** is intended to work with Python versions 3.9 to 3.12. Installation can be done with pip: .. code:: bash diff --git a/setup.py b/setup.py index 76df371c..ddb2f7f8 100644 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ setup( name="shapash", version=version_d["__version__"], - python_requires=">3.7, <3.12", + python_requires=">3.8, <3.13", url="https://github.com/MAIF/shapash", author="Yann Golhen, Sebastien Bidault, Yann Lagre, Maxime Gendre", author_email="yann.golhen@maif.fr", @@ -75,10 +75,10 @@ long_description_content_type="text/markdown", classifiers=[ "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 :: 3.12", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", ], From 2dc983e5ad998a6cee11eeb94eab2e3b5501f799 Mon Sep 17 00:00:00 2001 From: MaximeLecardonnel6x7 Date: Fri, 15 Mar 2024 10:01:26 +0100 Subject: [PATCH 2/3] Modification of github actions. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20b8759e..5e9c5589 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 1 matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} From 81c5397a403d73c232fa24d4ce797eeecc31c93b Mon Sep 17 00:00:00 2001 From: MaximeLecardonnel6x7 Date: Fri, 15 Mar 2024 14:44:28 +0100 Subject: [PATCH 3/3] Test pickle python version. --- tests/unit_tests/explainer/test_smart_explainer.py | 7 ++++--- tests/unit_tests/utils/test_load_smartpredictor.py | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/unit_tests/explainer/test_smart_explainer.py b/tests/unit_tests/explainer/test_smart_explainer.py index 97269c09..76db4cc1 100644 --- a/tests/unit_tests/explainer/test_smart_explainer.py +++ b/tests/unit_tests/explainer/test_smart_explainer.py @@ -1,6 +1,7 @@ """ Unit test for smart explainer """ + import os import sys import types @@ -633,14 +634,14 @@ def test_load_1(self): temp, xpl = init_sme_to_pickle_test() current = Path(path.abspath(__file__)).parent.parent.parent - if str(sys.version)[0:3] == "3.8": - pkl_file = path.join(current, "data/xpl_to_load_38.pkl") - elif str(sys.version)[0:3] == "3.9": + if str(sys.version)[0:3] == "3.9": pkl_file = path.join(current, "data/xpl_to_load_39.pkl") elif str(sys.version)[0:4] == "3.10": pkl_file = path.join(current, "data/xpl_to_load_310.pkl") elif str(sys.version)[0:4] == "3.11": pkl_file = path.join(current, "data/xpl_to_load_311.pkl") + elif str(sys.version)[0:4] == "3.12": + pkl_file = path.join(current, "data/xpl_to_load_312.pkl") else: raise NotImplementedError diff --git a/tests/unit_tests/utils/test_load_smartpredictor.py b/tests/unit_tests/utils/test_load_smartpredictor.py index 4ce82b2e..72af76f0 100644 --- a/tests/unit_tests/utils/test_load_smartpredictor.py +++ b/tests/unit_tests/utils/test_load_smartpredictor.py @@ -1,6 +1,7 @@ """ Unit test smart predictor """ + import sys import unittest from os import path @@ -29,12 +30,12 @@ def test_load_smartpredictor_1(self): current = Path(path.abspath(__file__)).parent.parent.parent if str(sys.version)[0:4] == "3.10": pkl_file = path.join(current, "data/predictor_to_load_310.pkl") - elif str(sys.version)[0:3] == "3.8": - pkl_file = path.join(current, "data/predictor_to_load_38.pkl") elif str(sys.version)[0:3] == "3.9": pkl_file = path.join(current, "data/predictor_to_load_39.pkl") elif str(sys.version)[0:4] == "3.11": pkl_file = path.join(current, "data/predictor_to_load_311.pkl") + elif str(sys.version)[0:4] == "3.12": + pkl_file = path.join(current, "data/predictor_to_load_312.pkl") else: raise NotImplementedError