diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 44131cb4..b434b5a0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install dependencies run: | pip install -Ur requirements.txt diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 90be685c..e4f27786 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 72991179..2ccfa104 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 1f1148ea..8c49ac8d 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2b0971a1..4f0c1d9b 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32e28d45..aabea774 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 @@ -28,7 +28,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [ "3.7", "3.8", "3.9" ] # pip install requirements fail on 3.10 + python-version: [ "3.7", "3.8", "3.9" ] # pip install requirements fail on 3.10 and 3.11 because of Fasttext steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 09427670..87ffa126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -296,3 +296,5 @@ - Fixed tags converter bug with data processor. ## dev + + - Add Python 3.11 diff --git a/codecov_push.sh b/codecov_push.sh index 3777fb58..8f90141d 100755 --- a/codecov_push.sh +++ b/codecov_push.sh @@ -2,11 +2,11 @@ # To run using ZSH: zsh -i ./codecov_push.sh # To run using bash: bash -i ./codecov_push.sh -# We do test on Python 3.10 +# We do test on Python 3.11 (latest Python version) # Create a new Python env for Deepparse tests and activate it -conda create --name deepparse_pytest_3_10 python=3.10 -y --force -conda activate deepparse_pytest_3_10 +conda create --name deepparse_pytest_3_11 python=3.11 -y --force +conda activate deepparse_pytest_3_11 # Install dependencies pip install -Ur tests/requirements.txt @@ -15,7 +15,7 @@ pip install -Ur requirements.txt # Run pytest from conda env echo "*****Running test in Conda*****" # --live-stream is to remove the Conda capture of the stream -conda run -n deepparse_pytest_3_10 --live-stream pytest --cov ./deepparse --cov-report html --cov-report xml --cov-config=.coveragerc +conda run -n deepparse_pytest_3_11 --live-stream pytest --cov ./deepparse --cov-report html --cov-report xml --cov-config=.coveragerc # Push the coverage file ./codecov -f coverage.xml -n unittest-integrationtest -t $CODECOVKEYDEEPPARSE @@ -23,4 +23,4 @@ conda run -n deepparse_pytest_3_10 --live-stream pytest --cov ./deepparse --cov- # close conda env conda deactivate -conda env remove -n deepparse_pytest_3_10 +conda env remove -n deepparse_pytest_3_11 diff --git a/run_tests_python_envs.sh b/run_tests_python_envs.sh index 23e23359..aa3f8b7d 100755 --- a/run_tests_python_envs.sh +++ b/run_tests_python_envs.sh @@ -1,7 +1,9 @@ #!/bin/sh +# To run using ZSH: zsh -i ./codecov_push.sh +# To run using bash: bash -i ./codecov_push.sh -# We test on Deepparse supported Python versions, namely, 3.7, 3.8, 3.9 and 3.10 -echo "*****Starting of testing Deepparse on Python version 3.7, 3.8, 3.9, 3.10*****" +# We test on Deepparse supported Python versions, namely, 3.7, 3.8, 3.9, 3.10 and 3.11 +echo "*****Starting of testing Deepparse on Python version 3.7, 3.8, 3.9, 3.10, 3.11*****" # We export the reports into a directory. But to do so, we need to move into that directory # and run pytest from there @@ -94,7 +96,29 @@ fi conda deactivate # Cleanup the conda env -conda env remove -n deepparse_pytest_3_10 +conda env remove -n deepparse_pytest_3_11 + +# Create a new Python env 3.11 +conda create --name deepparse_pytest_3_11 python=3.11 -y --force +conda activate deepparse_pytest_3_11 + +# Install dependencies +pip install -Ur ../tests/requirements.txt +pip install -Ur ../requirements.txt + +# Run pytest from conda env +echo "*****Running test in Conda Python version 3.11*****" +conda run -n deepparse_pytest_3_11 --live-stream pytest --cov ../deepparse --cov-report html:html_report_3_11 --cov-report xml:export_xml_report_3_11.xml --cov-config=.coveragerc ../tests + +if [ $? -eq 0 ]; then + python3_11_tests_res=1 +fi + +# close conda env +conda deactivate + +# Cleanup the conda env +conda env remove -n deepparse_pytest_3_11 # All tests env print echo "*****The results of the tests are:" @@ -128,6 +152,13 @@ else echo "Fail for Python 3.10" fi +if [ $python3_11_tests_res -eq 1 ]; then + echo "Success for Python 3.11" +else + return_status=1 + echo "Fail for Python 3.11" +fi + if [ $return_status -eq 1 ]; then exit 1 else diff --git a/setup.py b/setup.py index 6ff9812e..53c6818a 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,7 @@ def main(): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Scientific/Engineering",