From b599ef0f489ebe9651dc0146741d5a2b774fa874 Mon Sep 17 00:00:00 2001 From: Andreas Date: Wed, 2 Feb 2022 18:56:47 +0000 Subject: [PATCH 1/2] Add back surprise and remove from experimental --- setup.py | 6 ++---- tests/integration/examples/test_notebooks_python.py | 1 - tests/smoke/examples/test_notebooks_python.py | 1 - tests/unit/examples/test_notebooks_python.py | 1 - tests/unit/recommenders/models/test_surprise_utils.py | 2 -- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 427d0b0025..c1949e58be 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ "cornac>=1.1.2,<2", "retrying>=1.3.3", "pandera[strategies]>=0.6.5", # For generating fake datasets + "scikit-surprise>=1.0.6" ] # shared dependencies @@ -99,10 +100,7 @@ "nni==1.5", ] -# The following dependencies can be installed as below, however PyPI does not allow direct URLs. -# Surprise needs to be built from source because of the numpy <= 1.19 incompatibility -# Requires pip to be run with the --no-binary option -# "scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz", +# The following dependency can be installed as below, however PyPI does not allow direct URLs. # Temporary fix for pymanopt, only this commit works with TF2 # "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip", diff --git a/tests/integration/examples/test_notebooks_python.py b/tests/integration/examples/test_notebooks_python.py index 331eeed9e2..70c2145b4e 100644 --- a/tests/integration/examples/test_notebooks_python.py +++ b/tests/integration/examples/test_notebooks_python.py @@ -91,7 +91,6 @@ def test_baseline_deep_dive_integration( assert results[key] == pytest.approx(value, rel=TOL, abs=ABS_TOL) -@pytest.mark.experimental @pytest.mark.integration @pytest.mark.parametrize( "size, expected_values", diff --git a/tests/smoke/examples/test_notebooks_python.py b/tests/smoke/examples/test_notebooks_python.py index 2fa4c56564..1ca1b51bba 100644 --- a/tests/smoke/examples/test_notebooks_python.py +++ b/tests/smoke/examples/test_notebooks_python.py @@ -56,7 +56,6 @@ def test_baseline_deep_dive_smoke(notebooks, output_notebook, kernel_name): assert results["recall"] == pytest.approx(0.108826, rel=TOL, abs=ABS_TOL) -@pytest.mark.experimental @pytest.mark.smoke def test_surprise_svd_smoke(notebooks, output_notebook, kernel_name): notebook_path = notebooks["surprise_svd_deep_dive"] diff --git a/tests/unit/examples/test_notebooks_python.py b/tests/unit/examples/test_notebooks_python.py index cb74cd5b3e..d6083424b9 100644 --- a/tests/unit/examples/test_notebooks_python.py +++ b/tests/unit/examples/test_notebooks_python.py @@ -49,7 +49,6 @@ def test_baseline_deep_dive_runs(notebooks, output_notebook, kernel_name): pm.execute_notebook(notebook_path, output_notebook, kernel_name=kernel_name) -@pytest.mark.experimental @pytest.mark.notebooks def test_surprise_deep_dive_runs(notebooks, output_notebook, kernel_name): notebook_path = notebooks["surprise_svd_deep_dive"] diff --git a/tests/unit/recommenders/models/test_surprise_utils.py b/tests/unit/recommenders/models/test_surprise_utils.py index b363d4da38..57d4f15a28 100644 --- a/tests/unit/recommenders/models/test_surprise_utils.py +++ b/tests/unit/recommenders/models/test_surprise_utils.py @@ -52,7 +52,6 @@ def rating_true(): ) -@pytest.mark.experimental def test_predict(rating_true): svd = surprise.SVD() train_set = surprise.Dataset.load_from_df( @@ -87,7 +86,6 @@ def test_predict(rating_true): ].values == pytest.approx(svd.predict(user, item).est, rel=TOL) -@pytest.mark.experimental def test_recommend_k_items(rating_true): n_users = len(rating_true["userID"].unique()) n_items = len(rating_true["itemID"].unique()) From 043055378b455acb283d29f2bcf3944ffc8f82b5 Mon Sep 17 00:00:00 2001 From: Andreas Date: Thu, 3 Feb 2022 08:57:00 +0000 Subject: [PATCH 2/2] Remove no-binary installation --- docs/README.md | 3 +-- recommenders/README.md | 1 - tests/ci/azure_pipeline_test/dsvm_nightly_linux_cpu.yml | 2 +- tests/ci/azure_pipeline_test/dsvm_notebook_linux_cpu.yml | 2 +- tests/ci/azure_pipeline_test/dsvm_unit_linux_cpu.yml | 2 +- tests/ci/azure_pipeline_test/release_pipeline.yml | 6 +++--- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/README.md b/docs/README.md index e4f49c4744..4f4a6b2b90 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,8 +5,7 @@ To setup the documentation, first you need to install the dependencies of the fu conda create -n reco_full -c conda-forge python=3.7 cudatoolkit=11.2 cudnn=8.1 conda activate reco_full - pip install numpy cython - pip install --no-binary scikit-surprise "scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz" + pip install numpy pip install "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip" pip install sphinx_rtd_theme diff --git a/recommenders/README.md b/recommenders/README.md index 7301712a99..2260044e98 100644 --- a/recommenders/README.md +++ b/recommenders/README.md @@ -70,7 +70,6 @@ We are currently evaluating inclusion of the following dependencies: ## Other dependencies Some dependencies are not available via the recommenders PyPI package, but can be installed in the following ways: - - scikit-surprise: due to incompatibilities with `numpy <= 1.19`, proper installation of Surprise requires `pip install numpy cython` and `pip install --no-binary scikit-surprise "scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz"` - pymanopt: this dependency is required for the RLRMC and GeoIMC algorithms; a version of this code compatible with TensorFlow 2 can be installed with `pip install "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip"`. diff --git a/tests/ci/azure_pipeline_test/dsvm_nightly_linux_cpu.yml b/tests/ci/azure_pipeline_test/dsvm_nightly_linux_cpu.yml index 8c7a17d69b..1e8511f88e 100644 --- a/tests/ci/azure_pipeline_test/dsvm_nightly_linux_cpu.yml +++ b/tests/ci/azure_pipeline_test/dsvm_nightly_linux_cpu.yml @@ -33,6 +33,6 @@ extends: timeout: 180 conda_env: "nightly_linux_cpu" conda_opts: "python=3.7" - pip_opts: "[examples,dev,experimental] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise" + pip_opts: "[examples,dev,experimental] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache" pytest_markers: "not spark and not gpu" pytest_params: "-x" diff --git a/tests/ci/azure_pipeline_test/dsvm_notebook_linux_cpu.yml b/tests/ci/azure_pipeline_test/dsvm_notebook_linux_cpu.yml index 7118cb34b1..f08a8637ea 100644 --- a/tests/ci/azure_pipeline_test/dsvm_notebook_linux_cpu.yml +++ b/tests/ci/azure_pipeline_test/dsvm_notebook_linux_cpu.yml @@ -60,5 +60,5 @@ extends: task_name: "Test - Unit Notebook Linux CPU" conda_env: "unit_notebook_linux_cpu" conda_opts: "python=3.7" - pip_opts: "[examples,dev,experimental] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise" + pip_opts: "[examples,dev,experimental] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache" pytest_markers: "notebooks and not spark and not gpu" diff --git a/tests/ci/azure_pipeline_test/dsvm_unit_linux_cpu.yml b/tests/ci/azure_pipeline_test/dsvm_unit_linux_cpu.yml index eac67ec5ef..03a013b993 100644 --- a/tests/ci/azure_pipeline_test/dsvm_unit_linux_cpu.yml +++ b/tests/ci/azure_pipeline_test/dsvm_unit_linux_cpu.yml @@ -60,5 +60,5 @@ extends: task_name: "Test - Unit Linux CPU" conda_env: "unit_linux_cpu" conda_opts: "python=3.7" - pip_opts: "[dev,experimental] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise" + pip_opts: "[dev,experimental] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache" pytest_markers: "not notebooks and not spark and not gpu" diff --git a/tests/ci/azure_pipeline_test/release_pipeline.yml b/tests/ci/azure_pipeline_test/release_pipeline.yml index cad472cd3c..23b0448991 100644 --- a/tests/ci/azure_pipeline_test/release_pipeline.yml +++ b/tests/ci/azure_pipeline_test/release_pipeline.yml @@ -23,7 +23,7 @@ jobs: task_name: "Test - Unit Linux CPU" conda_env: "release_unit_linux_cpu" conda_opts: "python=3.7" - pip_opts: "[experimental,dev] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise" + pip_opts: "[experimental,dev] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache" pytest_markers: "not notebooks and not spark and not gpu" install: "release" package: "publish" @@ -35,7 +35,7 @@ jobs: task_name: "Test - Unit Notebook Linux CPU" conda_env: "release_unit_notebook_linux_cpu" conda_opts: "python=3.7" - pip_opts: "[experimental,examples,dev] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise" + pip_opts: "[experimental,examples,dev] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache" pytest_markers: "notebooks and not spark and not gpu" install: "release" @@ -93,7 +93,7 @@ jobs: timeout: 180 conda_env: "release_nightly_linux_cpu" conda_opts: "python=3.7" - pip_opts: "[experimental,examples,dev] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise" + pip_opts: "[experimental,examples,dev] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache" pytest_markers: "not spark and not gpu" install: "release"