From fec460befb0e22905e687368d4d1563d84ca7043 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 4 Oct 2023 10:11:12 +0200 Subject: [PATCH] Upgrade GitHub Actions --- .github/workflows/docker.yml | 2 +- .github/workflows/pre-commit-autoupdate.yml | 4 ++-- .github/workflows/pre-commit.yml | 4 ++-- .github/workflows/python_safety.yml | 16 ++++++++++++++++ .github/workflows/shellcheck.yml | 2 +- .github/workflows/test_python.yml | 7 +++---- .github/workflows/update_locales.yml | 5 +++-- motioneye/locale/motioneye.js.pot | 2 +- motioneye/locale/motioneye.pot | 4 ++-- motioneye/utils/http.py | 2 +- 10 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/python_safety.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a45fdf07e..28d349a22 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,7 +15,7 @@ jobs: packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Docker meta id: meta diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index b5915771a..3244823d2 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -16,7 +16,7 @@ jobs: pre-commit-autoupdate: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: dev # https://github.com/peter-evans/create-pull-request/issues/48 @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-python@v4 with: # https://github.com/actions/python-versions/releases - python-version: '3.11' + python-version: '3.12' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 997816d83..c841728d1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,11 +13,11 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: # https://github.com/actions/python-versions/releases - python-version: '3.11' + python-version: '3.12' - run: | pip install pre-commit pre-commit --version diff --git a/.github/workflows/python_safety.yml b/.github/workflows/python_safety.yml new file mode 100644 index 000000000..324719760 --- /dev/null +++ b/.github/workflows/python_safety.yml @@ -0,0 +1,16 @@ +name: python_safety + +on: [pull_request, push] + +jobs: + python_safety: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login + runs-on: 'ubuntu-22.04' + steps: + - run: sudo apt-get -q update + - run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends dist-upgrade + - run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends install + curl gcc ffmpeg libcurl4-openssl-dev libssl-dev motion v4l-utils + - uses: actions/checkout@v4 + - run: pip install --user safety . + - run: safety check diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index c958eb929..9b378d912 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -11,7 +11,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download shellcheck run: | curl -sSfL "$(curl -sSf 'https://api.github.com/repos/koalaman/shellcheck/releases/latest' | mawk -F\" '/"browser_download_url.*\.linux\.x86_64\.tar\.xz"/{print $4;exit}')" -o shellcheck.tar.xz diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 1c5a5ad70..306d9816a 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -15,15 +15,15 @@ jobs: runs-on: ${{ matrix.dist }} name: "Test on ${{ matrix.dist }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 - run: test '${{ matrix.dist }}' != 'ubuntu-22.04' || sudo apt-mark hold grub-efi-amd64-signed # Workaround for failing package upgrade on Jammy - run: sudo apt-get -q update - run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends dist-upgrade - run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends install curl gcc ffmpeg libcurl4-openssl-dev libssl-dev motion v4l-utils - run: python3 -m pip install --upgrade pip setuptools wheel - - run: python3 -m pip install --upgrade build mypy pytest safety + - run: python3 -m pip install --upgrade build mypy pytest - run: python3 -m build - run: python3 -m pip install . - run: mkdir --parents --verbose .mypy_cache @@ -33,4 +33,3 @@ jobs: - run: pytest --fixtures tests/test_utils/test_mjpeg.py || true - run: pytest --fixtures tests/test_utils/test_rtmp.py || true - run: pytest . || pytest --doctest-modules . || true - - run: safety check diff --git a/.github/workflows/update_locales.yml b/.github/workflows/update_locales.yml index b3e324a03..b2a14c93b 100644 --- a/.github/workflows/update_locales.yml +++ b/.github/workflows/update_locales.yml @@ -23,11 +23,12 @@ jobs: - name: Install dependencies run: | - python3 -m pip install -U babel jinja2 & + python3 -m pip install --upgrade pip setuptools + python3 -m pip install --upgrade babel jinja2 sudo apt-get -q update sudo DEBIAN_FRONTEND='noninteractive' apt-get -qq --no-install-recommends install gettext - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} # https://github.com/peter-evans/create-pull-request/issues/48 diff --git a/motioneye/locale/motioneye.js.pot b/motioneye/locale/motioneye.js.pot index 6f3c30021..576fdf969 100644 --- a/motioneye/locale/motioneye.js.pot +++ b/motioneye/locale/motioneye.js.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-28 17:58+0000\n" +"POT-Creation-Date: 2023-10-04 09:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/motioneye/locale/motioneye.pot b/motioneye/locale/motioneye.pot index 0708bce78..04f46c83c 100644 --- a/motioneye/locale/motioneye.pot +++ b/motioneye/locale/motioneye.pot @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-09-28 17:58+0000\n" +"POT-Creation-Date: 2023-10-04 09:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.12.1\n" +"Generated-By: Babel 2.13.0\n" #: motioneye/server.py:232 msgid "interrompa signalo ricevita, fermanta …" diff --git a/motioneye/utils/http.py b/motioneye/utils/http.py index 2c7b84de1..e6338d4e8 100644 --- a/motioneye/utils/http.py +++ b/motioneye/utils/http.py @@ -34,7 +34,7 @@ def _get_dict_field_val(cls, k: Union[str, Hashable], v: Any) -> Any: return v @classmethod - def from_dict(cls, d: dict) -> __qualname__: + def from_dict(cls, d: dict): # -> typing.Self in Python >= v3.11 return cls( **{ k: cls._get_dict_field_val(k, v)