From af017d175c7d4bacc2e29030eb03db6b0d7b8287 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Fri, 11 Jun 2021 10:36:40 +0300 Subject: [PATCH 1/7] Upgrade dependencies for v0.53 --- setup.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 3a02ee3f0..5fdfdbaaa 100644 --- a/setup.py +++ b/setup.py @@ -24,25 +24,25 @@ def read(fname): 'swagger_ui_bundle', 'flask', 'flask-cors', - 'click==7.1.*', + 'click==8.0.*', 'click-log', - 'joblib==0.17.0', + 'joblib==1.0.1', 'nltk', - 'gensim==3.8.*', + 'gensim==4.0.*', 'scikit-learn==0.24.2', - 'scipy==1.5.3', + 'scipy==1.6.3', 'rdflib>=4.2,<6.0', 'gunicorn', - 'numpy==1.18.*', - 'optuna==2.2.0', + 'numpy==1.19.*', + 'optuna==2.8.0', 'stwfsapy==0.2.*' ], tests_require=['py', 'pytest', 'requests'], extras_require={ 'fasttext': ['fasttext==0.9.2'], 'voikko': ['voikko'], - 'vw': ['vowpalwabbit==8.8.1'], - 'nn': ['tensorflow-cpu==2.3.1', 'lmdb==1.0.0'], + 'vw': ['vowpalwabbit==8.10.1'], + 'nn': ['tensorflow-cpu==2.5.0', 'lmdb==1.2.1'], 'omikuji': ['omikuji==0.3.*'], 'yake': ['yake==0.4.5'], 'dev': [ From 0c236ea846c54e440572dc7fd67ae32d13a63d78 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Fri, 11 Jun 2021 10:58:15 +0300 Subject: [PATCH 2/7] Include Python 3.9 for unit tests in GH Actions --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 29a6931d1..66b09477a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 From 60d7505eced1015f547d1e202530ec9700aab58e Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Mon, 14 Jun 2021 12:04:14 +0300 Subject: [PATCH 3/7] Install SciPy 1.5.4 because 1.6.* would require Python 3.7+ --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5fdfdbaaa..de424f5e7 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def read(fname): 'nltk', 'gensim==4.0.*', 'scikit-learn==0.24.2', - 'scipy==1.6.3', + 'scipy==1.5.4', 'rdflib>=4.2,<6.0', 'gunicorn', 'numpy==1.19.*', From 38523427abbd797699195780ddb3dd3d232343f8 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Tue, 15 Jun 2021 11:24:32 +0300 Subject: [PATCH 4/7] Upgrade VW to latest version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index de424f5e7..9a0de7fca 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ def read(fname): extras_require={ 'fasttext': ['fasttext==0.9.2'], 'voikko': ['voikko'], - 'vw': ['vowpalwabbit==8.10.1'], + 'vw': ['vowpalwabbit==8.10.2'], 'nn': ['tensorflow-cpu==2.5.0', 'lmdb==1.2.1'], 'omikuji': ['omikuji==0.3.*'], 'yake': ['yake==0.4.5'], From d5b39c04e892498d3dd9ccfac72711fa1bca95b7 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Tue, 15 Jun 2021 15:30:52 +0300 Subject: [PATCH 5/7] Install optional python-Levenshtein to get rid of warning --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 9a0de7fca..98e7f8a97 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,7 @@ def read(fname): 'joblib==1.0.1', 'nltk', 'gensim==4.0.*', + 'python-Levenshtein', 'scikit-learn==0.24.2', 'scipy==1.5.4', 'rdflib>=4.2,<6.0', From cba511aa0d443c0cd669b731656cb387a5062567 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Wed, 16 Jun 2021 12:10:56 +0300 Subject: [PATCH 6/7] Remove python-Levenshtein pkg; filter warnings about missing it --- annif/backend/tfidf.py | 8 ++++++-- setup.py | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/annif/backend/tfidf.py b/annif/backend/tfidf.py index c42f6aa97..c55f633d9 100644 --- a/annif/backend/tfidf.py +++ b/annif/backend/tfidf.py @@ -3,14 +3,18 @@ import os.path import tempfile -import gensim.similarities -from gensim.matutils import Sparse2Corpus import annif.util from annif.suggestion import VectorSuggestionResult from annif.exception import NotInitializedException, NotSupportedException from . import backend from . import mixins +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore') + import gensim.similarities + from gensim.matutils import Sparse2Corpus + class SubjectBuffer: """A file-backed buffer to store and retrieve subject text.""" diff --git a/setup.py b/setup.py index 98e7f8a97..9a0de7fca 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,6 @@ def read(fname): 'joblib==1.0.1', 'nltk', 'gensim==4.0.*', - 'python-Levenshtein', 'scikit-learn==0.24.2', 'scipy==1.5.4', 'rdflib>=4.2,<6.0', From 1b3b7863d1d2cef6a6583e14a08d9b8bbf3bb596 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Wed, 16 Jun 2021 14:03:07 +0300 Subject: [PATCH 7/7] Add comment for filtering warnings about missig python-Levenshtein pkg --- annif/backend/tfidf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/annif/backend/tfidf.py b/annif/backend/tfidf.py index c55f633d9..995aede0c 100644 --- a/annif/backend/tfidf.py +++ b/annif/backend/tfidf.py @@ -9,6 +9,7 @@ from . import backend from . import mixins +# Filter UserWarnings due to not-installed python-Levenshtein package import warnings with warnings.catch_warnings(): warnings.simplefilter('ignore')