From 9d8d57d5c57d4ac6056af69a296587da9ae763f2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:06:24 +0200 Subject: [PATCH 1/3] added ruff config --- ruff.toml | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 ruff.toml diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..153a5c7 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,74 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 79 +indent-width = 4 + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E", "F", "W"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" From 868a9132e5d2c7657a54b6a96575a42db88bf33c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:06:31 +0200 Subject: [PATCH 2/3] added linting action --- .github/workflows/pr_linting.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/pr_linting.yml diff --git a/.github/workflows/pr_linting.yml b/.github/workflows/pr_linting.yml new file mode 100644 index 0000000..3d2431b --- /dev/null +++ b/.github/workflows/pr_linting.yml @@ -0,0 +1,24 @@ +name: 📇 Code Linting + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number}} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: write + +jobs: + linting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 From 763f918a0825754b89e77734a591bcc398a6b380 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:06:45 +0200 Subject: [PATCH 3/3] fix reported linting issues --- client/ayon_third_party/constants.py | 2 +- create_package.py | 20 +++++++++++++++----- server/settings.py | 16 ++++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/client/ayon_third_party/constants.py b/client/ayon_third_party/constants.py index 65f966b..58535ce 100644 --- a/client/ayon_third_party/constants.py +++ b/client/ayon_third_party/constants.py @@ -1 +1 @@ -ADDON_NAME = "ayon_third_party" \ No newline at end of file +ADDON_NAME = "ayon_third_party" diff --git a/create_package.py b/create_package.py index 8bb9cb2..f524506 100644 --- a/create_package.py +++ b/create_package.py @@ -43,29 +43,39 @@ FFMPEG_SOURCES = { "windows": { "url": f"{DISTRIBUTE_SOURCE_URL}/ffmpeg-4.4-windows-2.zip", - "checksum": "5f09109c96a3e53beec042e969653716324b467c66788807e69e81c233e19d20", + "checksum": ( + "5f09109c96a3e53beec042e969653716324b467c66788807e69e81c233e19d20" + ), "checksum_algorithm": "sha256", }, "linux": { "url": f"{DISTRIBUTE_SOURCE_URL}/ffmpeg-4.4-linux.tgz", - "checksum": "10b9beda57cfbb69b9ed0ce896c0c8d99227b26ca8b9f611040c4752e365cbe9", + "checksum": ( + "10b9beda57cfbb69b9ed0ce896c0c8d99227b26ca8b9f611040c4752e365cbe9" + ), "checksum_algorithm": "sha256", }, "darwin": { "url": f"{DISTRIBUTE_SOURCE_URL}/ffmpeg-4.4-macos.tgz", - "checksum": "95f43568338c275f80dc0cab1e1836a2e2270f856f0e7b204440d881dd74fbdb", + "checksum": ( + "95f43568338c275f80dc0cab1e1836a2e2270f856f0e7b204440d881dd74fbdb" + ), "checksum_algorithm": "sha256", } } OIIO_SOURCES = { "windows": { "url": f"{DISTRIBUTE_SOURCE_URL}/oiio_tools-2.3.10-windows.zip", - "checksum": "b9950f5d2fa3720b52b8be55bacf5f56d33f9e029d38ee86534995f3d8d253d2", + "checksum": ( + "b9950f5d2fa3720b52b8be55bacf5f56d33f9e029d38ee86534995f3d8d253d2" + ), "checksum_algorithm": "sha256", }, "linux": { "url": f"{DISTRIBUTE_SOURCE_URL}/oiio_tools-2.2.20-linux-centos7.tgz", - "checksum": "3894dec7e4e521463891a869586850e8605f5fd604858b674c87323bf33e273d", + "checksum": ( + "3894dec7e4e521463891a869586850e8605f5fd604858b674c87323bf33e273d" + ), "checksum_algorithm": "sha256", } } diff --git a/server/settings.py b/server/settings.py index 6d9862e..858fbf2 100644 --- a/server/settings.py +++ b/server/settings.py @@ -1,9 +1,7 @@ -from pydantic import Field, validator +from pydantic import Field from ayon_server.settings import ( BaseSettingsModel, - task_types_enum, - MultiplatformPathModel, MultiplatformPathListModel, ) @@ -38,7 +36,9 @@ class FFmpegSettings(BaseSettingsModel): custom_args: CustomFFmpegArgumentsModel = Field( default_factory=CustomFFmpegArgumentsModel, title="Custom arguments", - description="Custom arguments that will be used to launch ffmpeg tools", + description=( + "Custom arguments that will be used to launch ffmpeg tools" + ), ) @@ -82,12 +82,16 @@ class OIIOSettings(BaseSettingsModel): custom_roots: MultiplatformPathListModel = Field( default_factory=MultiplatformPathListModel, title="Custom root", - description="Root to directory where OpenImageIO binaries can be found", + description=( + "Root to directory where OpenImageIO binaries can be found" + ), ) custom_args: CustomOIIOArgumentsModel = Field( default_factory=CustomOIIOArgumentsModel, title="Custom arguments", - description="Custom arguments that will be used to launch ffmpeg tools", + description=( + "Custom arguments that will be used to launch ffmpeg tools" + ), )