From 39a169a8c62550d4a6de1051ec0f8d12d2a1ef2f Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Wed, 22 May 2024 08:29:48 +0200 Subject: [PATCH] Bump development environment --- .pylintrc | 15 --------------- __init__.py | 1 - requirements.txt | 1 + tox.ini | 33 ++++++++++++++++++++++----------- 4 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 .pylintrc create mode 100644 requirements.txt diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 7b44546..0000000 --- a/.pylintrc +++ /dev/null @@ -1,15 +0,0 @@ -[MESSAGES CONTROL] - -disable= - fixme, - line-too-long, - wrong-import-order, - missing-module-docstring, - missing-class-docstring, - missing-function-docstring, - invalid-name, - too-many-arguments, - too-few-public-methods, - too-many-locals, - too-many-instance-attributes, - assignment-from-no-return, # Happens because of bpy stubs layout lack return statements diff --git a/__init__.py b/__init__.py index b47bd21..a4b2586 100644 --- a/__init__.py +++ b/__init__.py @@ -391,7 +391,6 @@ def find_bad_tracks(clip: MovieClip) -> Dict[str, Badness]: def find_duplicate_tracks(clip: MovieClip) -> Iterable[Duplicate]: - # For each clip frame... first_frame_index = clip.frame_start last_frame_index = clip.frame_start + clip.frame_duration - 1 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f46f114 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +fake-bpy-module-2.93 == 20211212 \ No newline at end of file diff --git a/tox.ini b/tox.ini index bee6940..c879eb6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,13 @@ [tox] # NOTE: Should match one of the [gh-actions] configs below -envlist = black, mypy, pylint +envlist = ruff-format, mypy, ruff-check + +ruff_version = 0.4.4 [testenv] basepython = python3 skip_install = true +allowlist_externals = /bin/bash [gh-actions] # NOTE: Should match the python-versions list in main.yml @@ -13,22 +16,30 @@ skip_install = true # from the [tox] envlist above? python = 3.9: mypy - 3.10: black, mypy, pylint # NOTE: Should mat [tox] envlist above + 3.10: ruff-format, mypy, ruff-check # NOTE: Should mat [tox] envlist above -[testenv:black] -deps = black == 21.12b0 +[testenv:ruff-format] +deps = + ruff=={[tox]ruff_version} # Format locally, check in CI and fail on not-formatted code -commands = /bin/bash -c 'if [ "{env:CI:}" ] ; then export CHECK="--check --diff --color" ; fi ; black $CHECK __init__.py' +commands = /bin/bash -c 'if [ "{env:CI:}" ] ; then CHECK="--check --diff" ; fi ; ruff format $CHECK __init__.py' [testenv:mypy] deps = - mypy == 0.931 - fake-bpy-module-2.93 == 20211212 + mypy == 1.10.0 + -r requirements.txt commands = mypy __init__.py -[testenv:pylint] +[testenv:ruff-check] +# Depend on ruff-format to not complain about formatting errors +depends = ruff-format + deps = - pylint == 2.12.2 - fake-bpy-module-2.93 == 20211212 -commands = pylint __init__.py + ruff=={[tox]ruff_version} + pytest==8.2.1 + -r requirements.txt + +# Auto-fix locally but not in CI +commands = + /bin/bash -c 'FIX="--fix" ; if [ "{env:CI:}" ] ; then FIX="--no-fix" ; fi ; ruff check $FIX __init__.py'