Skip to content

Commit

Permalink
Merge pull request #101 from uclahs-cds/dependabot/pip/pyright-1.1.377
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] committed Aug 21, 2024
2 parents f527e00 + f5ed5e3 commit cc11d03
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- main

jobs:
CICD-base:
static-analysis:
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/database/BL_Python/database/migrations/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/development/BL_Python/development/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/platform/BL_Python/platform/identity/user_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/web/BL_Python/web/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/web/BL_Python/web/scaffolding/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
6 changes: 4 additions & 2 deletions src/web/BL_Python/web/scaffolding/scaffolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cc11d03

Please sign in to comment.