Repository: France-Travail/words_n_fun (language: python)

Issue:
Improve required packages versions
### Problem

Almost all packages versions need exact match in both requirements.txt and setup.py. This can create version incompatibilities for projects that need specifics third party libraries.

### Solution

- **MVP:** Add range version for most common packages (pandas, numpy, etc...)

- **Possible additions:** Add range version for all packages + test min and max versions

### Additional context

How can we test this ? Random range ? Min-max ?


Discussion / hints:
Some libraries should not be added ino the setup.py file (such as tests libraries).
However, we should test the requirements.txt file (otherwise it is useless).

Fix patch:
diff --git a/requirements.txt b/requirements.txt
index d785c77..a35a0e6 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,27 +1,29 @@
 # Data manipulation
-numpy==1.19.5
-pandas==1.3.5
+numpy==1.21.6; python_version < "3.8"
+numpy==1.23.2; python_version >= "3.8"
+pandas==1.3.5; python_version < "3.8"
+pandas==1.4.4; python_version >= "3.8"
 
 # NLP
-nltk==3.4.5
-ftfy==5.8
+nltk==3.7
+ftfy==6.1.1
 
 # Others
-simplejson==3.17.2
-tqdm==4.62.2
-requests==2.23.0
+tqdm==4.64.1
+simplejson==3.17.6
+requests==2.28.1
 
 # Optionnals - code quality & cie
-flake8==3.7.9
-black==19.10b0
-isort==4.3.21
+flake8==5.0.4
+black==22.8.0
+isort==5.10.1
 nose==1.3.7
 nose-exclude==0.5.0
-coverage==5.3
+coverage==6.4.4
 
 # Has to be installed last / optionnal to use spacy lemmatizer
 markupsafe==2.0.1  # BUG FIX -> https://github.com/aws/aws-sam-cli/issues/3661
 Cython==0.29.24
 spacy==3.3.1
-# The following line downloads a spacy model. It can be commented if you don't have an internet access to download it, but lemmatizer features won't work.
+# The following line downloads a frnech spacy model. It can be commented if you don't have an internet access to download it, but lemmatizer features won't work.
 https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.3.0/fr_core_news_sm-3.3.0-py3-none-any.whl
diff --git a/setup.py b/setup.py
index 74eaaec..1472b9f 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@
 # Get package directory
 package_directory = os.path.dirname(os.path.abspath(__file__))
 
-# Get package version (env variable or verion file + -local)
+# Get package version (env variable or version file + -local)
 version_path = os.path.join(package_directory, 'version.txt')
 with open(version_path, 'r') as version_file:
     version = version_file.read().strip()
@@ -38,22 +38,26 @@
     license='AGPL-3.0',
     long_description=long_description,
     long_description_content_type='text/markdown',
-    author='Agence Data Services PE Nantes',
+    author="Agence Data Services PE Nantes",
+    author_email="contactadsaiframeworks.00619@pole-emploi.fr",
     description="Semantic library of the Data Services agency",
     url="https://github.com/OSS-Pole-Emploi/words_n_fun",
     platforms=['windows', 'linux'],
+    python_requires='>=3.7',
     package_data={
         'words_n_fun': ['configs/*.json', 'nltk_data/corpora/stopwords/french']
     },
     include_package_data=True,
     install_requires=[
-        'pandas==1.3.5',
-        'numpy==1.19.5',
-        'nltk>=3.4.5,<3.6',
-        'tqdm==4.62.2',  # https://github.com/tqdm/tqdm/issues/780
-        'simplejson>=3.17.0,<3.17.3',
-        'requests>=2.23.0,<2.25.1',
-        'ftfy>=5.8,<6.0',
+        'pandas>=1.3,<1.4; python_version < "3.8"',
+        'pandas>=1.3,<1.5; python_version >= "3.8"',
+        'numpy>=1.19,<1.22; python_version < "3.8"',
+        'numpy>=1.19,<1.24; python_version >= "3.8"',
+        'nltk>=3.4,<3.8',
+        'ftfy>=5.8,<6.2',
+        'tqdm>=4.40,<4.65',
+        'simplejson>=3.17,<3.18',
+        'requests>=2.23,<2.29',
     ],
     extras_require={
         "lemmatizer": ["spacy==3.3.1", "markupsafe==2.0.1", "Cython==0.29.24", "fr-core-news-sm==3.3.0"]


Test patch:
diff --git a/.github/workflows/wnf_build_tests.yaml b/.github/workflows/wnf_build_tests.yaml
index 79bd408..16e4480 100644
--- a/.github/workflows/wnf_build_tests.yaml
+++ b/.github/workflows/wnf_build_tests.yaml
@@ -11,7 +11,7 @@ on:
       - 'LICENSE'
       - 'Makefile'
   pull_request:
-    types: [opened, reopened, edit]
+    types: [opened, reopened, edit, synchronize]
     branches:
       - 'main'
       - 'release/v*'