From f02bbacf2fcbaf00e01de16f07309244e3316cea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 00:59:50 +0000 Subject: [PATCH 1/5] Bump ruff from 0.1.13 to 0.1.14 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.13 to 0.1.14. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.13...v0.1.14) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 39 ++++++++++++++++++++------------------- pyproject.toml | 2 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index 95aa98b..35c53f1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1134,6 +1134,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -1253,28 +1254,28 @@ middleware = ["webob"] [[package]] name = "ruff" -version = "0.1.13" +version = "0.1.14" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.13-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:e3fd36e0d48aeac672aa850045e784673449ce619afc12823ea7868fcc41d8ba"}, - {file = "ruff-0.1.13-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9fb6b3b86450d4ec6a6732f9f60c4406061b6851c4b29f944f8c9d91c3611c7a"}, - {file = "ruff-0.1.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b13ba5d7156daaf3fd08b6b993360a96060500aca7e307d95ecbc5bb47a69296"}, - {file = "ruff-0.1.13-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9ebb40442f7b531e136d334ef0851412410061e65d61ca8ce90d894a094feb22"}, - {file = "ruff-0.1.13-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:226b517f42d59a543d6383cfe03cccf0091e3e0ed1b856c6824be03d2a75d3b6"}, - {file = "ruff-0.1.13-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5f0312ba1061e9b8c724e9a702d3c8621e3c6e6c2c9bd862550ab2951ac75c16"}, - {file = "ruff-0.1.13-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2f59bcf5217c661254bd6bc42d65a6fd1a8b80c48763cb5c2293295babd945dd"}, - {file = "ruff-0.1.13-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e6894b00495e00c27b6ba61af1fc666f17de6140345e5ef27dd6e08fb987259d"}, - {file = "ruff-0.1.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a1600942485c6e66119da294c6294856b5c86fd6df591ce293e4a4cc8e72989"}, - {file = "ruff-0.1.13-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ee3febce7863e231a467f90e681d3d89210b900d49ce88723ce052c8761be8c7"}, - {file = "ruff-0.1.13-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:dcaab50e278ff497ee4d1fe69b29ca0a9a47cd954bb17963628fa417933c6eb1"}, - {file = "ruff-0.1.13-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f57de973de4edef3ad3044d6a50c02ad9fc2dff0d88587f25f1a48e3f72edf5e"}, - {file = "ruff-0.1.13-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:7a36fa90eb12208272a858475ec43ac811ac37e91ef868759770b71bdabe27b6"}, - {file = "ruff-0.1.13-py3-none-win32.whl", hash = "sha256:a623349a505ff768dad6bd57087e2461be8db58305ebd5577bd0e98631f9ae69"}, - {file = "ruff-0.1.13-py3-none-win_amd64.whl", hash = "sha256:f988746e3c3982bea7f824c8fa318ce7f538c4dfefec99cd09c8770bd33e6539"}, - {file = "ruff-0.1.13-py3-none-win_arm64.whl", hash = "sha256:6bbbc3042075871ec17f28864808540a26f0f79a4478c357d3e3d2284e832998"}, - {file = "ruff-0.1.13.tar.gz", hash = "sha256:e261f1baed6291f434ffb1d5c6bd8051d1c2a26958072d38dfbec39b3dda7352"}, + {file = "ruff-0.1.14-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:96f76536df9b26622755c12ed8680f159817be2f725c17ed9305b472a757cdbb"}, + {file = "ruff-0.1.14-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ab3f71f64498c7241123bb5a768544cf42821d2a537f894b22457a543d3ca7a9"}, + {file = "ruff-0.1.14-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7060156ecc572b8f984fd20fd8b0fcb692dd5d837b7606e968334ab7ff0090ab"}, + {file = "ruff-0.1.14-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a53d8e35313d7b67eb3db15a66c08434809107659226a90dcd7acb2afa55faea"}, + {file = "ruff-0.1.14-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bea9be712b8f5b4ebed40e1949379cfb2a7d907f42921cf9ab3aae07e6fba9eb"}, + {file = "ruff-0.1.14-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:2270504d629a0b064247983cbc495bed277f372fb9eaba41e5cf51f7ba705a6a"}, + {file = "ruff-0.1.14-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80258bb3b8909b1700610dfabef7876423eed1bc930fe177c71c414921898efa"}, + {file = "ruff-0.1.14-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:653230dd00aaf449eb5ff25d10a6e03bc3006813e2cb99799e568f55482e5cae"}, + {file = "ruff-0.1.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87b3acc6c4e6928459ba9eb7459dd4f0c4bf266a053c863d72a44c33246bfdbf"}, + {file = "ruff-0.1.14-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6b3dadc9522d0eccc060699a9816e8127b27addbb4697fc0c08611e4e6aeb8b5"}, + {file = "ruff-0.1.14-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1c8eca1a47b4150dc0fbec7fe68fc91c695aed798532a18dbb1424e61e9b721f"}, + {file = "ruff-0.1.14-py3-none-musllinux_1_2_i686.whl", hash = "sha256:62ce2ae46303ee896fc6811f63d6dabf8d9c389da0f3e3f2bce8bc7f15ef5488"}, + {file = "ruff-0.1.14-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b2027dde79d217b211d725fc833e8965dc90a16d0d3213f1298f97465956661b"}, + {file = "ruff-0.1.14-py3-none-win32.whl", hash = "sha256:722bafc299145575a63bbd6b5069cb643eaa62546a5b6398f82b3e4403329cab"}, + {file = "ruff-0.1.14-py3-none-win_amd64.whl", hash = "sha256:e3d241aa61f92b0805a7082bd89a9990826448e4d0398f0e2bc8f05c75c63d99"}, + {file = "ruff-0.1.14-py3-none-win_arm64.whl", hash = "sha256:269302b31ade4cde6cf6f9dd58ea593773a37ed3f7b97e793c8594b262466b67"}, + {file = "ruff-0.1.14.tar.gz", hash = "sha256:ad3f8088b2dfd884820289a06ab718cde7d38b94972212cc4ba90d5fbc9955f3"}, ] [[package]] @@ -1576,4 +1577,4 @@ test = ["gevent (>=20.6.2)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "93b42f4aaee458977b968ce19d163074c292b67937f5f295bfb3a077a19ffeff" +content-hash = "7c051a2da8f36e3f11289e37942835e4e636629ab18707557b55807f1ca200d8" diff --git a/pyproject.toml b/pyproject.toml index 13e9c70..a4f906d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ voluptuous = "^0.14.1" [tool.poetry.group.dev.dependencies] black = "^23.3.0" mypy = "^1.4.1" -ruff = "^0.1.13" +ruff = "^0.1.14" types-pytz = ">=2023.3.0.0" [build-system] From e60ca955226b7e1959eb8456beaf4370618b1365 Mon Sep 17 00:00:00 2001 From: meanmail Date: Thu, 25 Jan 2024 14:49:19 +0100 Subject: [PATCH 2/5] Update import statement and reorder exceptions list An import statement in 'stepik_plugins_client/rpcapi.py' was updated to handle the linter warning. Also, rearranged the exceptions list in 'stepic_plugins/exceptions.py' for clarity and ease of use. --- stepic_plugins/exceptions.py | 4 ++-- stepik_plugins_client/rpcapi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stepic_plugins/exceptions.py b/stepic_plugins/exceptions.py index 5433bfe..2f84873 100644 --- a/stepic_plugins/exceptions.py +++ b/stepic_plugins/exceptions.py @@ -9,9 +9,9 @@ ) __all__ = [ - "PluginError", "FormatError", + "PluginError", + "PluginTimeoutError", "QuizSetUpError", "UnknownPluginError", - "PluginTimeoutError", ] diff --git a/stepik_plugins_client/rpcapi.py b/stepik_plugins_client/rpcapi.py index a1b27bc..eaf9ff5 100644 --- a/stepik_plugins_client/rpcapi.py +++ b/stepik_plugins_client/rpcapi.py @@ -5,7 +5,7 @@ import oslo_messaging as messaging from oslo_config import cfg -from oslo_messaging.rpc.client import _client_opts +from oslo_messaging.rpc.client import _client_opts # noqa: PLC2701 from stepik_plugins_client.schema import RPCSerializer From 5733079f5d048519599ae2501dfab2a8bf354741 Mon Sep 17 00:00:00 2001 From: meanmail Date: Thu, 25 Jan 2024 14:56:50 +0100 Subject: [PATCH 3/5] Remove 'black' from dev dependencies The 'black' package was removed from the development dependencies in the 'pyproject.toml' file. This change could be due to it not being required for development anymore, or perhaps it was causing some conflicts. --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a4f906d..4279346 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,6 @@ structlog = ">=23.1.0" voluptuous = "^0.14.1" [tool.poetry.group.dev.dependencies] -black = "^23.3.0" mypy = "^1.4.1" ruff = "^0.1.14" types-pytz = ">=2023.3.0.0" From 2fa577bd95870a90d0502b6cb59bc9491b6fb016 Mon Sep 17 00:00:00 2001 From: meanmail Date: Thu, 25 Jan 2024 14:57:19 +0100 Subject: [PATCH 4/5] Add auto-author-assign workflow This commit introduces a new GitHub actions workflow auto-author-assign. This workflow automatically assigns the author to a pull request upon its creation or reopening, using self-hosted runners with a timeout of 30 minutes. --- .github/workflows/auto-author-assign.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/auto-author-assign.yml diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml new file mode 100644 index 0000000..62d531b --- /dev/null +++ b/.github/workflows/auto-author-assign.yml @@ -0,0 +1,16 @@ +name: Auto Author Assign + +on: + pull_request_target: + types: [ opened, reopened ] + +permissions: + pull-requests: write + +jobs: + assign-author: + runs-on: [self-hosted, small] + timeout-minutes: 30 + if: ${{ !github.event.pull_request.assignee }} + steps: + - uses: toshimaru/auto-author-assign@v2.1.0 From 8168e69ba35c8d609a5c61e35a79945b90dfb3d5 Mon Sep 17 00:00:00 2001 From: meanmail Date: Thu, 25 Jan 2024 14:57:26 +0100 Subject: [PATCH 5/5] Add auto-formatting GitHub workflow This commit introduces a new auto-format GitHub workflow. This is designed to automatically format code for pull requests and pushes to the 'master' branch, using self-hosted runners with a 30-minute timeout. The code formatting tool used is ruff. --- .github/workflows/auto-format.yml | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/auto-format.yml diff --git a/.github/workflows/auto-format.yml b/.github/workflows/auto-format.yml new file mode 100644 index 0000000..e27ae1c --- /dev/null +++ b/.github/workflows/auto-format.yml @@ -0,0 +1,43 @@ +name: Format code +on: + pull_request: + push: + branches: + - 'master' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + format_backend: + name: Format with ruff + runs-on: [ self-hosted, small ] + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + + - name: Install Poetry + run: pipx install poetry==$(head -n 1 .poetry-version) + + - uses: actions/setup-python@v5 + with: + python-version-file: '.python-version' + cache: 'poetry' + + - name: Install dependencies + run: poetry install --only main,dev --no-interaction --no-ansi + + - run: poetry run ruff --fix --unsafe-fixes --preview --exit-zero . + - run: poetry run ruff format . + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + fetch: false + default_author: github_actions + message: 'Backend: Auto format' + add: '.'