diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 602e3ebc..e5d026ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,31 +12,31 @@ repos: - id: check-useless-excludes - id: identity - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - id: check-ast -- repo: https://github.com/psf/black - rev: 22.6.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black args: [--config=app/pyproject-ci.toml] - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 8.0.1 hooks: - id: isort name: isort (python) args: [--settings-file=app/pyproject-ci.toml] - repo: https://github.com/pycqa/pylint - rev: v2.14.4 + rev: v4.0.5 hooks: - id: pylint args: [--rcfile=app/pyproject-ci.toml] - repo: https://github.com/asottile/pyupgrade - rev: 'v2.37.1' + rev: 'v3.21.2' hooks: - id: pyupgrade args: [--py38-plus] diff --git a/app/core/admin.py b/app/core/admin.py index 79d7cd55..7f025fe3 100644 --- a/app/core/admin.py +++ b/app/core/admin.py @@ -235,9 +235,9 @@ def formfield_for_foreignkey(self, db_field, request, **kwargs): input_value = models.InputValue.objects.get(pk=input_value_id) if db_field.name == "input_element": - kwargs[ - "queryset" - ] = input_value.value_type.challenge.inputelement_set.order_by("name") + kwargs["queryset"] = ( + input_value.value_type.challenge.inputelement_set.order_by("name") + ) return super().formfield_for_foreignkey(db_field, request, **kwargs) diff --git a/app/core/batching.py b/app/core/batching.py index f43d112a..bb8ea9c0 100644 --- a/app/core/batching.py +++ b/app/core/batching.py @@ -1,6 +1,7 @@ """ Batch up file types. """ + import csv import os.path import tempfile diff --git a/app/core/filecache.py b/app/core/filecache.py index 9d03286d..933b252c 100644 --- a/app/core/filecache.py +++ b/app/core/filecache.py @@ -1,6 +1,7 @@ """ When we have files stored on S3, we want to seamlessly manage local copies for submission to containers. """ + import logging import os.path import shutil diff --git a/app/core/management/commands/sample_data.py b/app/core/management/commands/sample_data.py index ef6f52b8..b91b9811 100644 --- a/app/core/management/commands/sample_data.py +++ b/app/core/management/commands/sample_data.py @@ -138,7 +138,7 @@ def handle(self, *args, **options): # pylint:disable=unused-argument User = get_user_model() - (user, _) = User.objects.get_or_create( + user, _ = User.objects.get_or_create( username="milo", email="braxton.robbason@gmail.com" ) foo_url = "https://foo.com" diff --git a/app/core/models/admin_managed.py b/app/core/models/admin_managed.py index 37297170..25c59635 100644 --- a/app/core/models/admin_managed.py +++ b/app/core/models/admin_managed.py @@ -106,9 +106,9 @@ def fully_loaded(self): element_visibilities.add(element.is_public) if element_visibilities != {False, True}: valid = False - errors[ - "Need both public and private elements" - ] = f"Found {element_visibilities}" + errors["Need both public and private elements"] = ( + f"Found {element_visibilities}" + ) if not valid: raise NotFullyLoadedException(str(self), errors) diff --git a/app/core/values_helper.py b/app/core/values_helper.py index 68b6fbce..e1b57acf 100644 --- a/app/core/values_helper.py +++ b/app/core/values_helper.py @@ -2,6 +2,7 @@ Given an InputElement, load pairs of dicts of value_type.key: value one for files, one for non-files """ + from typing import TYPE_CHECKING, List if TYPE_CHECKING: diff --git a/app/manage.py b/app/manage.py index ff3306ce..e19e0caf 100755 --- a/app/manage.py +++ b/app/manage.py @@ -1,5 +1,6 @@ #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" + import os import sys diff --git a/app/sampl/base_settings.py b/app/sampl/base_settings.py index 331682ff..44548fa5 100644 --- a/app/sampl/base_settings.py +++ b/app/sampl/base_settings.py @@ -1,6 +1,7 @@ """ Django settings for SAMPL project. """ + # Custom settings for SAMPL VISUALIZE_DASK_GRAPH = False DASK_SCHEDULER_URL = "localhost:8786" diff --git a/app/sampl/urls.py b/app/sampl/urls.py index 3b35596e..f2263cbf 100644 --- a/app/sampl/urls.py +++ b/app/sampl/urls.py @@ -1,4 +1,5 @@ """SAMPL URL Configuration""" + from django.conf import settings from django.contrib import admin from django.urls import include, path