From 748bd6a9f946b9aca6fe93c6b6a1fca85dbdc538 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:10:22 -0600 Subject: [PATCH 1/7] Mark project as deprecated --- README.md | 7 +++++++ pyproject.toml | 2 +- scikeras/__init__.py | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3dabbfa..6183a75c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # Scikit-Learn Wrapper for Keras +> [!WARNING] +> This project is now deprecated. Keras has re-introduced wrappers with a similar API to those in SciKeras, but they will be better maintained. +> SciKeras was a project to meet a specific need that was developed by a single developer. +> I no longer use Keras nor do I have the time to maintain this project, which became increasingly difficult with multiple versions of Keras and Scikit-Learn to support. +> I thank all of the users and contributors over the years and hope that the new Keras wrappers will meet your needs. +> TODO: add link to Keras docs and release here. + [![Build Status](https://github.com/adriangb/scikeras/workflows/Tests/badge.svg)](https://github.com/adriangb/scikeras/actions?query=workflow%3ATests+branch%3Amaster) [![Coverage Status](https://codecov.io/gh/adriangb/scikeras/branch/master/graph/badge.svg)](https://codecov.io/gh/adriangb/scikeras) [![Docs](https://github.com/adriangb/scikeras/workflows/Build%20Docs/badge.svg)](https://www.adriangb.com/scikeras/) diff --git a/pyproject.toml b/pyproject.toml index f4e3ef1e..1facbb02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ license = "MIT" name = "scikeras" readme = "README.md" repository = "https://github.com/adriangb/scikeras" -version = "0.13.0" +version = "0.14.0" [tool.poetry.dependencies] python = ">=3.9.0,<4" diff --git a/scikeras/__init__.py b/scikeras/__init__.py index 9ef12516..630e49ea 100644 --- a/scikeras/__init__.py +++ b/scikeras/__init__.py @@ -3,6 +3,7 @@ __author__ = """Adrian Garcia Badaracco""" import importlib.metadata as importlib_metadata +from warnings import warn __version__ = importlib_metadata.version("scikeras") # type: ignore @@ -15,3 +16,14 @@ _keras.losses.Loss.__reduce__ = _saving_utils.pack_keras_loss _keras.metrics.Metric.__reduce__ = _saving_utils.pack_keras_metric _keras.optimizers.Optimizer.__reduce__ = _saving_utils.pack_keras_optimizer + +warn( + """ + This project is now deprecated. Keras has re-introduced wrappers with a similar API to those in SciKeras, but they will be better maintained. + SciKeras was a project to meet a specific need that was developed by a single developer. + I no longer use Keras nor do I have the time to maintain this project, which became increasingly difficult with multiple versions of Keras and Scikit-Learn to support. + I thank all of the users and contributors over the years and hope that the new Keras wrappers will meet your needs. + TODO: add link to Keras docs and release here. + """, + stacklevel=1, +) From 91c053618007f344908dd5a5446ac5c249c82e03 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:11:43 -0600 Subject: [PATCH 2/7] update actions/upload-artifact --- .github/workflows/build_docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index 80ae3ff5..4e948cce 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -47,7 +47,7 @@ jobs: run: echo "${{ github.ref }}" >> docs/_build/ref.txt - name: Save docs artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: docs path: docs/_build/* From 540b91134844f27a4f506079c785685ee8336d46 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:22:32 -0600 Subject: [PATCH 3/7] try updating requirements to get ci to run --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1facbb02..57a8e19b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ repository = "https://github.com/adriangb/scikeras" version = "0.14.0" [tool.poetry.dependencies] -python = ">=3.9.0,<4" +python = ">=3.9.0,<3.13" scikit-learn = ">=1.4.2" keras = ">=3.2.0" tensorflow = { version = ">=2.16.1", optional = true } @@ -52,7 +52,7 @@ pytest = ">=7.1.2" pytest-cov = ">=3.0.0" sphinx = ">=5.0.2" tensorflow = ">=2.16.1" -tensorflow-io-gcs-filesystem = { version = "<=0.31.0", markers = "python_version < '3.12' and sys_platform == 'win32'" } +tensorflow-io-gcs-filesystem = { version = "0.37.1" } [tool.ruff] select = [ From 31b7ab3cdf01b16be4fab20f3af747dc88bac859 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:24:58 -0600 Subject: [PATCH 4/7] add upper bound on scikit-learn --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 57a8e19b..5e7c616f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ version = "0.14.0" [tool.poetry.dependencies] python = ">=3.9.0,<3.13" -scikit-learn = ">=1.4.2" +scikit-learn = ">=1.4.2,<1.6.0" keras = ">=3.2.0" tensorflow = { version = ">=2.16.1", optional = true } From f3e047368cccd56b24681f98be01140d73a5178d Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:25:53 -0600 Subject: [PATCH 5/7] remove test dev job --- .github/workflows/tests.yaml | 43 ------------------------------------ 1 file changed, 43 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 18a0fdd6..c30083f0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -63,49 +63,6 @@ jobs: - uses: codecov/codecov-action@v1 - TestDev: - name: Ubuntu / Python ${{ matrix.python-version }} / TensorFlow Nightly / Scikit-Learn Nightly - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - fail-fast: false - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install and Set Up Poetry - run: | - python -m pip install --upgrade poetry - poetry config virtualenvs.in-project true - poetry run python -m pip install --upgrade pip - - - name: Install Dependencies - run: | - poetry remove scikit-learn - poetry install - - - name: Install Nightly Versions - if: always() - run: | - poetry run python -m pip install -U scipy - poetry run python -m pip install -U git+https://github.com/keras-team/keras.git - poetry run python -m pip install -U --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple scikit-learn - - - name: Test with pytest - if: always() - continue-on-error: true - run: | - poetry run python -m pip freeze - poetry run python -m pytest -v --cov=scikeras --cov-report xml --color=yes - - - uses: codecov/codecov-action@v1 - TestOldest: name: Ubuntu / Python ${{ matrix.python-version }} / TF ${{ matrix.tf-version }} / Scikit-Learn ${{ matrix.sklearn-version }} runs-on: ubuntu-latest From 5ba597eec089928314bff099f3e3b7ca70cedae3 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:36:17 -0600 Subject: [PATCH 6/7] pin to compatible Keras versions --- pyproject.toml | 6 +++++- scikeras/__init__.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5e7c616f..d0754aa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ version = "0.14.0" [tool.poetry.dependencies] python = ">=3.9.0,<3.13" scikit-learn = ">=1.4.2,<1.6.0" -keras = ">=3.2.0" +keras = ">=3.2.0,<3.7.0" tensorflow = { version = ">=2.16.1", optional = true } [tool.poetry.extras] @@ -82,3 +82,7 @@ show_missing = true [build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core>=1.0.8"] + +# ignore pytest warnings about missing __file__ attribute +[tool.pytest.ini_options] +filterwarnings = "ignore::DeprecationWarning:scikeras" \ No newline at end of file diff --git a/scikeras/__init__.py b/scikeras/__init__.py index 630e49ea..b32b7c73 100644 --- a/scikeras/__init__.py +++ b/scikeras/__init__.py @@ -25,5 +25,6 @@ I thank all of the users and contributors over the years and hope that the new Keras wrappers will meet your needs. TODO: add link to Keras docs and release here. """, + DeprecationWarning, stacklevel=1, ) From 6a1ac386798d7b0363330f2eed211e7c677c1e5c Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:39:42 -0600 Subject: [PATCH 7/7] remove windows --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c30083f0..86ffcc97 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -105,7 +105,7 @@ jobs: runs-on: ${{ matrix.os }}-latest strategy: matrix: - os: [MacOS, Windows] # test all OSs except Ubuntu, which is already running other tests + os: [MacOS] # test all OSs except Ubuntu, which is already running other tests python-version: ["3.9", "3.11"] # test only the two extremes of supported Python versions tensorflow-version: ["2.16.1"] # test only the two extremes of supported TF versions fail-fast: false