diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 608753d8..ccfdabb2 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -10,7 +10,7 @@ on: - main jobs: - CICD-base: + static-analysis: runs-on: ubuntu-latest steps: diff --git a/pyproject.toml b/pyproject.toml index 90f2e666..aa19bf37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,7 @@ dev-dependencies = [ "junit2html >= 30.1,< 32.0", # Pyright >= 1.1.367 breaks the build. # Waiting for new pyright release to fix it. https://github.com/uclahs-cds/BL_Python/issues/79 - "pyright == 1.1.376", + "pyright == 1.1.377", "isort ~= 5.13", "ruff ~= 0.3", "bandit[sarif,toml] ~= 1.7" diff --git a/src/database/BL_Python/database/migrations/alembic/env.py b/src/database/BL_Python/database/migrations/alembic/env.py index d8e51404..ee8f0ace 100644 --- a/src/database/BL_Python/database/migrations/alembic/env.py +++ b/src/database/BL_Python/database/migrations/alembic/env.py @@ -27,7 +27,7 @@ def get_migration_config(config_filename: Path | None = None): ssm_parameters = SSMParameters() database_config = ssm_parameters.load_config(config_type) except Exception as e: - logging.getLogger().warn(f"SSM parameter load failed: {e}") + logging.getLogger().warning(f"SSM parameter load failed: {e}") if database_config is None: database_config = load_config(config_type, config_filename) diff --git a/src/development/BL_Python/development/profiling.py b/src/development/BL_Python/development/profiling.py index 34cfab9d..8454818d 100644 --- a/src/development/BL_Python/development/profiling.py +++ b/src/development/BL_Python/development/profiling.py @@ -26,7 +26,7 @@ def decorated_view(*args: "Any", **kwargs: "Any"): with cProfile.Profile() as pr: result = pr.runcall(fn, *args, **kwargs) profile_filename = f"profile.{fn.__name__}.{''.join(choice(ascii_letters) for _ in range(8))}" - Logger("PROFILE").warn(f"Saving profile to {profile_filename}") + Logger("PROFILE").warning(f"Saving profile to {profile_filename}") pr.dump_stats(profile_filename) return result diff --git a/src/platform/BL_Python/platform/feature_flag/caching_feature_flag_router.py b/src/platform/BL_Python/platform/feature_flag/caching_feature_flag_router.py index 0c7a21a9..bf86cb84 100644 --- a/src/platform/BL_Python/platform/feature_flag/caching_feature_flag_router.py +++ b/src/platform/BL_Python/platform/feature_flag/caching_feature_flag_router.py @@ -17,15 +17,15 @@ def _notify_change( ) -> None: if name in self._feature_flags: if new_value == old_value: - self._logger.warn( + self._logger.warning( f"Tried to change feature flag value for '{name}' to the same value. It is already {'enabled' if new_value else 'disabled'}." ) else: - self._logger.warn( + self._logger.warning( f"Changing feature flag value for '{name}' from `{old_value}` to `{new_value}`." ) else: - self._logger.warn(f"Setting new feature flag '{name}' to `{new_value}`.") + self._logger.warning(f"Setting new feature flag '{name}' to `{new_value}`.") def _validate_name(self, name: str): if type(name) != str: diff --git a/src/platform/BL_Python/platform/feature_flag/db_feature_flag_router.py b/src/platform/BL_Python/platform/feature_flag/db_feature_flag_router.py index b7fabbe7..a3aa493d 100644 --- a/src/platform/BL_Python/platform/feature_flag/db_feature_flag_router.py +++ b/src/platform/BL_Python/platform/feature_flag/db_feature_flag_router.py @@ -136,7 +136,7 @@ def feature_is_enabled( ) if feature_flag is None: - self._logger.warn( + self._logger.warning( f'Feature flag {name} not found in database. Returning "{default}" by default.' ) return default diff --git a/src/platform/BL_Python/platform/identity/user_loader.py b/src/platform/BL_Python/platform/identity/user_loader.py index 5fa11abc..7b2e6aa3 100644 --- a/src/platform/BL_Python/platform/identity/user_loader.py +++ b/src/platform/BL_Python/platform/identity/user_loader.py @@ -92,7 +92,7 @@ def user_loader( self._log.debug(f'Loading user "{username}"') if not username: - self._log.warn("`username` is empty. Skipping load.") + self._log.warning("`username` is empty. Skipping load.") return with self._scoped_session() as session: diff --git a/src/web/BL_Python/web/application.py b/src/web/BL_Python/web/application.py index cf84f00b..2a0e94a8 100644 --- a/src/web/BL_Python/web/application.py +++ b/src/web/BL_Python/web/application.py @@ -123,7 +123,7 @@ def create_app( ssm_parameters = SSMParameters() full_config = ssm_parameters.load_config(config_type) except Exception as e: - logging.getLogger().warn(f"SSM parameter load failed: {e}") + logging.getLogger().warning(f"SSM parameter load failed: {e}") if full_config is None: if config_overrides: diff --git a/src/web/BL_Python/web/scaffolding/__main__.py b/src/web/BL_Python/web/scaffolding/__main__.py index cc2abc20..488dee63 100644 --- a/src/web/BL_Python/web/scaffolding/__main__.py +++ b/src/web/BL_Python/web/scaffolding/__main__.py @@ -157,7 +157,7 @@ def _parse_args(self, args: list[str]) -> ScaffoldParsedArgs: endpoint.url_path_name: endpoint for endpoint in _args.endpoints } if APPLICATION_ENDPOINT_PATH_NAME in endpoints: - self._log.warn( + self._log.warning( f'The endpoint name "{APPLICATION_ENDPOINT_PATH_NAME}" is reserved and will not be scaffolded.' ) _args.endpoints.remove(endpoints[APPLICATION_ENDPOINT_PATH_NAME]) diff --git a/src/web/BL_Python/web/scaffolding/scaffolder.py b/src/web/BL_Python/web/scaffolding/scaffolder.py index 0cbaaf50..eab43128 100644 --- a/src/web/BL_Python/web/scaffolding/scaffolder.py +++ b/src/web/BL_Python/web/scaffolding/scaffolder.py @@ -95,7 +95,9 @@ def _create_directory(self, directory: Path, overwrite_existing_files: bool = Tr self._checked_directories.add(directory) if overwrite_existing_files and directory.exists(): - self._log.warn(f"Directory `{directory}` exists. Files may be overwritten.") + self._log.warning( + f"Directory `{directory}` exists. Files may be overwritten." + ) else: self._log.debug(f"Creating directory `{directory}`.") # the "overwrite" check only applies in this method @@ -177,7 +179,7 @@ def _render_template( ) if overwrite_existing_files == False and template_output_path.exists(): - self._log.warn( + self._log.warning( f"File `{template_output_path}` exists, but refusing to overwrite." ) return