From ec64c34f551490ba99d7f7f1f9102e77c469050c Mon Sep 17 00:00:00 2001 From: AKB0700 <157992575+AKB0700@users.noreply.github.com> Date: Tue, 3 Mar 2026 03:29:00 +0800 Subject: [PATCH 1/5] Add GitHub Actions workflow for Python package This workflow installs Python dependencies, runs tests, and lints code with multiple Python versions. --- .github/workflows/python-package.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..e56abb6 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # 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: | + pytest From f699db1d5b3fb0b9926aaa6908e83a69cf357acc Mon Sep 17 00:00:00 2001 From: AKB0700 <157992575+AKB0700@users.noreply.github.com> Date: Tue, 3 Mar 2026 04:06:26 +0800 Subject: [PATCH 2/5] Add requests to requirements for CI --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests From d538ef08368e3eb3f9c52d58def66beb93f60720 Mon Sep 17 00:00:00 2001 From: AKB0700 <157992575+AKB0700@users.noreply.github.com> Date: Wed, 4 Mar 2026 03:58:27 +0800 Subject: [PATCH 3/5] Update .github/workflows/python-package.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/python-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e56abb6..2cf9778 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,8 +27,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + python -m pip install poetry + poetry config virtualenvs.create false + poetry install --no-interaction --no-root python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From 78db0d13b1ad21b56a1d0b7cba8534af4ac43db1 Mon Sep 17 00:00:00 2001 From: AKB0700 <157992575+AKB0700@users.noreply.github.com> Date: Wed, 4 Mar 2026 04:00:01 +0800 Subject: [PATCH 4/5] Update .github/workflows/python-package.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/python-package.yml | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 2cf9778..a5968d8 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -21,22 +21,22 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install poetry - poetry config virtualenvs.create false - poetry install --no-interaction --no-root - python -m pip install flake8 pytest - - name: Lint with flake8 - run: | - # 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: | - pytest + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # 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: | + pytest From 26ef617026166817682486dfd88e256894d855a7 Mon Sep 17 00:00:00 2001 From: AKB0700 <157992575+AKB0700@users.noreply.github.com> Date: Wed, 4 Mar 2026 04:00:22 +0800 Subject: [PATCH 5/5] Update .github/workflows/python-package.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/python-package.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a5968d8..0afc0fc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -4,10 +4,9 @@ name: Python package on: - push: - branches: [ "main" ] pull_request: branches: [ "main" ] + workflow_dispatch: jobs: build: