From 39e77ef94c6c03b8c59524e55f21e4a1d9287f17 Mon Sep 17 00:00:00 2001 From: La Min Ko Date: Mon, 25 Nov 2019 16:10:17 +0630 Subject: [PATCH 1/6] Create pythonapp.yml --- .github/workflows/pythonapp.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pythonapp.yml diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml new file mode 100644 index 0000000..c29c69c --- /dev/null +++ b/.github/workflows/pythonapp.yml @@ -0,0 +1,30 @@ +name: Python application + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint with flake8 + run: | + pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pip install pytest + python -s -m pytest --doctest-modules tests/ myanmar/ From 458c03cff0c3c2d990ba69e1ddedf1694e4b4458 Mon Sep 17 00:00:00 2001 From: La Min Ko Date: Tue, 19 Aug 2025 11:56:16 +0700 Subject: [PATCH 2/6] Update pythonapp.yml from 3.7 to 3.11 --- .github/workflows/pythonapp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index c29c69c..30fc958 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -9,10 +9,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.7 + - name: Set up Python 3.11 uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.11 - name: Install dependencies run: | python -m pip install --upgrade pip From dd99e8303cc1aaa8b20c03b8d94ed8050ffb1e1d Mon Sep 17 00:00:00 2001 From: La Min Ko Date: Tue, 19 Aug 2025 11:59:07 +0700 Subject: [PATCH 3/6] Update pythonapp.yml - fix incomptible flake8 version issue --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 30fc958..625079b 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -19,7 +19,7 @@ jobs: pip install -r requirements.txt - name: Lint with flake8 run: | - pip install flake8 + pip install -U "flake8==7.3.0" # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide From b809368dc3a0c0587f1a67e3a378d535eb927ae2 Mon Sep 17 00:00:00 2001 From: La Min Ko Date: Tue, 19 Aug 2025 12:01:09 +0700 Subject: [PATCH 4/6] Update test_phonenumber.py - fix F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple) --- tests/test_phonenumber.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_phonenumber.py b/tests/test_phonenumber.py index 88576f9..8f4c67e 100644 --- a/tests/test_phonenumber.py +++ b/tests/test_phonenumber.py @@ -104,5 +104,5 @@ def test_check_operator(): def test_landline_operator(): - assert mp.get_landline_operator('+95674601234') is "MyanmarAPN" - assert mp.get_landline_operator('9514244321') is "FortuneInternational" + assert mp.get_landline_operator('+95674601234') == "MyanmarAPN" + assert mp.get_landline_operator('9514244321') == "FortuneInternational" From ed8688ba14254d3461a1fff0c6bf4a88a20d458e Mon Sep 17 00:00:00 2001 From: La Min Ko Date: Tue, 19 Aug 2025 12:03:24 +0700 Subject: [PATCH 5/6] Update pythonapp.yml - update pytest version to 8.4.1 to be compatible with python 3.11 --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 625079b..c6d292c 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -26,5 +26,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pip install pytest + pip install "pytest==8.4.1" python -s -m pytest --doctest-modules tests/ myanmar/ From 056535099ee43e363d7222727d636828cd6f1116 Mon Sep 17 00:00:00 2001 From: La Min Ko Date: Tue, 19 Aug 2025 12:36:53 +0700 Subject: [PATCH 6/6] Update pythonapp.yml - remove flake8 and pytest from installation step --- .github/workflows/pythonapp.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index c6d292c..7887e3a 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -19,12 +19,10 @@ jobs: pip install -r requirements.txt - name: Lint with flake8 run: | - pip install -U "flake8==7.3.0" # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pip install "pytest==8.4.1" python -s -m pytest --doctest-modules tests/ myanmar/