From fa0f38b6878357a966743a8696c1f9bdac80300f Mon Sep 17 00:00:00 2001 From: Charles Moore <122481442+moorec-aws@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:57:21 +0000 Subject: [PATCH] ci: skip formatting for python 3.7 Signed-off-by: Charles Moore <122481442+moorec-aws@users.noreply.github.com> --- .github/workflows/reuse_python_build.yml | 4 +++- requirements-testing.txt | 3 +-- .../client/ui/dialogs/deadline_config_dialog.py | 6 +++--- src/deadline/job_attachments/caches/hash_cache.py | 4 +++- .../job_attachments/caches/s3_check_cache.py | 4 +++- test/unit/deadline_job_attachments/test_vfs.py | 12 ++++++------ 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/reuse_python_build.yml b/.github/workflows/reuse_python_build.yml index 73b6e9d11..038ba8b4b 100644 --- a/.github/workflows/reuse_python_build.yml +++ b/.github/workflows/reuse_python_build.yml @@ -52,8 +52,10 @@ jobs: echo "::add-mask::$CODEARTIFACT_AUTH_TOKEN" echo CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN >> $GITHUB_ENV pip install --upgrade hatch - + - name: Run Linting + # Skipping formatting check due black 23.3 security risks on python 3.7 + if: ${{ matrix.python-version != 3.7 }} run: hatch -v run lint - name: Run Build diff --git a/requirements-testing.txt b/requirements-testing.txt index 2d5b711ed..77606e821 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -9,8 +9,7 @@ freezegun == 1.* types-pyyaml == 6.* twine == 4.*; python_version == '3.7' twine == 5.*; python_version > '3.7' -black == 23.3.*; python_version == '3.7' -black == 23.*; python_version > '3.7' +black == 24.*; python_version > '3.7' mypy == 1.4.*; python_version == '3.7' mypy == 1.*; python_version > '3.7' ruff == 0.3.* diff --git a/src/deadline/client/ui/dialogs/deadline_config_dialog.py b/src/deadline/client/ui/dialogs/deadline_config_dialog.py index 3fe91de86..fe7cc465f 100644 --- a/src/deadline/client/ui/dialogs/deadline_config_dialog.py +++ b/src/deadline/client/ui/dialogs/deadline_config_dialog.py @@ -546,9 +546,9 @@ def apply(self) -> bool: """ # We need to retrieve here as changing Queue's won't update. - self.changes[ - "settings.storage_profile_id" - ] = self.default_storage_profile_box.box.currentData() + self.changes["settings.storage_profile_id"] = ( + self.default_storage_profile_box.box.currentData() + ) for setting_name, value in self.changes.items(): if value.startswith(NOT_VALID_MARKER): diff --git a/src/deadline/job_attachments/caches/hash_cache.py b/src/deadline/job_attachments/caches/hash_cache.py index 996f0118b..ca3e00bc0 100644 --- a/src/deadline/job_attachments/caches/hash_cache.py +++ b/src/deadline/job_attachments/caches/hash_cache.py @@ -49,7 +49,9 @@ class HashCache(CacheDB): def __init__(self, cache_dir: Optional[str] = None) -> None: table_name: str = f"hashesV{self.CACHE_DB_VERSION}" - create_query: str = f"CREATE TABLE hashesV{self.CACHE_DB_VERSION}(file_path text primary key, hash_algorithm text secondary key, file_hash text, last_modified_time timestamp)" + create_query: str = ( + f"CREATE TABLE hashesV{self.CACHE_DB_VERSION}(file_path text primary key, hash_algorithm text secondary key, file_hash text, last_modified_time timestamp)" + ) super().__init__( cache_name=self.CACHE_NAME, table_name=table_name, diff --git a/src/deadline/job_attachments/caches/s3_check_cache.py b/src/deadline/job_attachments/caches/s3_check_cache.py index fdb9b87ff..abff4f3ad 100644 --- a/src/deadline/job_attachments/caches/s3_check_cache.py +++ b/src/deadline/job_attachments/caches/s3_check_cache.py @@ -48,7 +48,9 @@ class S3CheckCache(CacheDB): def __init__(self, cache_dir: Optional[str] = None) -> None: table_name: str = f"s3checkV{self.CACHE_DB_VERSION}" - create_query: str = f"CREATE TABLE s3checkV{self.CACHE_DB_VERSION}(s3_key text primary key, last_seen_time timestamp)" + create_query: str = ( + f"CREATE TABLE s3checkV{self.CACHE_DB_VERSION}(s3_key text primary key, last_seen_time timestamp)" + ) super().__init__( cache_name=self.CACHE_NAME, table_name=table_name, diff --git a/test/unit/deadline_job_attachments/test_vfs.py b/test/unit/deadline_job_attachments/test_vfs.py index c7533df21..5978c2495 100644 --- a/test/unit/deadline_job_attachments/test_vfs.py +++ b/test/unit/deadline_job_attachments/test_vfs.py @@ -330,9 +330,9 @@ def test_find_vfs_launch_script_with_env_set( f"{deadline.__package__}.job_attachments.vfs.os.path.exists" ) as mock_os_path_exists: mock_os_path_exists.return_value = True - deadline_vfs_launch_script_path: Union[ - os.PathLike, str - ] = process_manager.find_vfs_launch_script() + deadline_vfs_launch_script_path: Union[os.PathLike, str] = ( + process_manager.find_vfs_launch_script() + ) assert ( str(deadline_vfs_launch_script_path) == vfs_test_path + DEADLINE_VFS_EXECUTABLE_SCRIPT @@ -372,9 +372,9 @@ def test_find_vfs_launch_script_with_env_not_set( f"{deadline.__package__}.job_attachments.vfs.os.path.exists" ) as mock_os_path_exists: mock_os_path_exists.return_value = True - deadline_vfs_launch_script_path: Union[ - os.PathLike, str - ] = process_manager.find_vfs_launch_script() + deadline_vfs_launch_script_path: Union[os.PathLike, str] = ( + process_manager.find_vfs_launch_script() + ) # Will return preset vfs install path with exe script path appended since env is not set assert (