From 1dda70182d1215e0009787841b76baaeeaf3355a Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Thu, 14 Sep 2023 10:21:02 +0200 Subject: [PATCH 1/6] Replace (defunct) Travis with Github Actions --- .github/workflows/test.yaml | 28 ++++++++++++++++++++++++++++ .travis.yml | 27 --------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..6801fbe --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,28 @@ +name: Python package + +on: [push] + +jobs: + build: + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + - name: Test with pytest + run: | + python -m unittest discover -s sacremoses/test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f9e328b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: python - -os: linux -dist: focal - -addons: - apt: - packages: - - expect-dev - -python: # https://docs.travis-ci.com/user/languages/python/ - - "3.6" - - "3.8" - - "3.9" - - "pypy3" - - "3.10.1" - -cache: pip - -install: - - pip install joblib # For parallelization. - - pip install click # For CLI. - - pip install tqdm # For progressbar. - - pip install regex # For regex (simpler access to perluniprops) - -script: - - unbuffer python -m unittest discover sacremoses/test/ -v From e9c5bf48d06ef27f8ce2ad8089e69dad062ff54f Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Thu, 14 Sep 2023 10:31:12 +0200 Subject: [PATCH 2/6] Drop testing 3.6 and 3.7 explicitly Since 3.8 was already the default on Ubuntu 20.04. Also specify a specific version of pypy. --- .github/workflows/test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6801fbe..2fa6e96 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,7 +8,10 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"] + python-version: [ + "3.8", "3.9", "3.10", "3.11", + pypy3.9" + ] runs-on: ${{ matrix.os }} From 5ec8e5e8ba4b32b3c5741b9d84778f03f81ad74c Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Thu, 14 Sep 2023 10:31:59 +0200 Subject: [PATCH 3/6] Typo --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2fa6e96..cf6bc4a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,7 +10,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [ "3.8", "3.9", "3.10", "3.11", - pypy3.9" + "pypy3.9" ] runs-on: ${{ matrix.os }} From d219c347726e4f866af3e81d213359735db87ee1 Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Thu, 14 Sep 2023 10:33:41 +0200 Subject: [PATCH 4/6] Call the job "test" and step "unit tests" --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cf6bc4a..4b712d7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,7 +3,7 @@ name: Python package on: [push] jobs: - build: + test: strategy: matrix: @@ -26,6 +26,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -r requirements.txt - - name: Test with pytest + - name: Test unit tests run: | python -m unittest discover -s sacremoses/test From b8169ed749f95e89c1f0af67e0aaa171868586c9 Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Thu, 14 Sep 2023 12:25:55 +0200 Subject: [PATCH 5/6] Add minimum version Todo: Also bump version number as this is technically breaking compatibility --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 5ac6781..72016a8 100644 --- a/setup.py +++ b/setup.py @@ -22,4 +22,5 @@ ], install_requires = ['regex', 'click', 'joblib', 'tqdm'], entry_points=console_scripts, + python_required='>3.8', ) From 4a1ac803cd4a9cf02ff14cf9a7a3abd1903e3f98 Mon Sep 17 00:00:00 2001 From: Jelmer van der Linde Date: Thu, 14 Sep 2023 12:42:48 +0200 Subject: [PATCH 6/6] I can't read the docs --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 72016a8..67dcbd2 100644 --- a/setup.py +++ b/setup.py @@ -22,5 +22,5 @@ ], install_requires = ['regex', 'click', 'joblib', 'tqdm'], entry_points=console_scripts, - python_required='>3.8', + python_requires='>=3.8', )