diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 49756020..07d03644 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: psf/black@stable + - uses: psf/black@24.1.1 with: src: "./project/thscoreboard" diff --git a/project/thscoreboard/replays/game_ids.py b/project/thscoreboard/replays/game_ids.py index 3d31a964..2358491d 100644 --- a/project/thscoreboard/replays/game_ids.py +++ b/project/thscoreboard/replays/game_ids.py @@ -66,7 +66,9 @@ class NameLength(enum.Enum): GameIDs.TH01: ( pgettext_lazy("short game name", "th01"), pgettext_lazy("standard game name", "The Highly Responsive to Prayers"), - pgettext_lazy("full game name", "東方靈異伝 - The Highly Responsive to Prayers"), + pgettext_lazy( + "full game name", "東方靈異伝 - The Highly Responsive to Prayers" + ), ), GameIDs.TH02: ( pgettext_lazy("short game name", "th02"), @@ -76,7 +78,9 @@ class NameLength(enum.Enum): GameIDs.TH03: ( pgettext_lazy("short game name", "th03"), pgettext_lazy("standard game name", "The Phantasmagoria of Dim. Dream"), - pgettext_lazy("full game name", "東方夢時空 - The Phantasmagoria of Dim. Dream"), + pgettext_lazy( + "full game name", "東方夢時空 - The Phantasmagoria of Dim. Dream" + ), ), GameIDs.TH04: ( pgettext_lazy("short game name", "th04"), @@ -106,7 +110,9 @@ class NameLength(enum.Enum): GameIDs.TH09: ( pgettext_lazy("short game name", "th09"), pgettext_lazy("standard game name", "Phantasmagoria of Flower View"), - pgettext_lazy("full game name", "東方花映塚 - Phantasmagoria of Flower View"), + pgettext_lazy( + "full game name", "東方花映塚 - Phantasmagoria of Flower View" + ), ), GameIDs.TH10: ( pgettext_lazy("short game name", "th10"), @@ -151,7 +157,9 @@ class NameLength(enum.Enum): GameIDs.TH17: ( pgettext_lazy("short game name", "th17"), pgettext_lazy("standard game name", "Wily Beast and Weakest Creature"), - pgettext_lazy("full game name", "東方鬼形獣 - Wily Beast and Weakest Creature"), + pgettext_lazy( + "full game name", "東方鬼形獣 - Wily Beast and Weakest Creature" + ), ), GameIDs.TH18: ( pgettext_lazy("short game name", "th18"), diff --git a/project/thscoreboard/replays/models.py b/project/thscoreboard/replays/models.py index f827b563..4499180d 100644 --- a/project/thscoreboard/replays/models.py +++ b/project/thscoreboard/replays/models.py @@ -1,6 +1,5 @@ """Contains all of the models for the replay site.""" - import dataclasses import datetime from typing import Optional diff --git a/project/thscoreboard/replays/test_rank_replays.py b/project/thscoreboard/replays/test_rank_replays.py index ca91d218..81c71541 100644 --- a/project/thscoreboard/replays/test_rank_replays.py +++ b/project/thscoreboard/replays/test_rank_replays.py @@ -20,9 +20,9 @@ def _create_n_replays(self, n: int, is_tas: bool = False) -> None: user=self.user, score=1_000_000_000 - 100_000_000 * i, difficulty=0, - category=models.Category.TAS - if is_tas - else models.Category.STANDARD, + category=( + models.Category.TAS if is_tas else models.Category.STANDARD + ), ) def testRanksAgainstAllReplays(self): diff --git a/project/thscoreboard/replays/views/edit_replay.py b/project/thscoreboard/replays/views/edit_replay.py index 64cbe20f..bba084f9 100644 --- a/project/thscoreboard/replays/views/edit_replay.py +++ b/project/thscoreboard/replays/views/edit_replay.py @@ -1,6 +1,5 @@ """Views related to editing an existing replay.""" - from django import urls from django import shortcuts from django.template import response as template_response diff --git a/project/thscoreboard/replays/views/user.py b/project/thscoreboard/replays/views/user.py index 34d7c51d..f047c05e 100644 --- a/project/thscoreboard/replays/views/user.py +++ b/project/thscoreboard/replays/views/user.py @@ -1,6 +1,5 @@ """The public page for a user's information.""" - from django.contrib import auth from django.shortcuts import get_object_or_404, render from django.views.decorators import http as http_decorators diff --git a/project/thscoreboard/users/forms.py b/project/thscoreboard/users/forms.py index 3814d9ca..889b26d6 100644 --- a/project/thscoreboard/users/forms.py +++ b/project/thscoreboard/users/forms.py @@ -164,22 +164,22 @@ def clean(self): username=silentselene_username ).exists() if not silentselene_is_valid: - errors[ - "silentselene_username" - ] = f"Silentselene user {silentselene_username} does not exist." + errors["silentselene_username"] = ( + f"Silentselene user {silentselene_username} does not exist." + ) royalflare_username = cleaned_data["royalflare_username"] royalflare_replays = Replay.objects.filter( imported_username__iexact=royalflare_username ) if not royalflare_replays.exists(): - errors[ - "royalflare_username" - ] = f"No Royalflare replays found for username {royalflare_username}." + errors["royalflare_username"] = ( + f"No Royalflare replays found for username {royalflare_username}." + ) elif not royalflare_replays.filter(user__isnull=True).exists(): - errors[ - "royalflare_username" - ] = f"All replays for {royalflare_username} have already been assigned." + errors["royalflare_username"] = ( + f"All replays for {royalflare_username} have already been assigned." + ) if len(errors) > 0: raise forms.ValidationError(errors) diff --git a/project/thscoreboard/users/other_views.py b/project/thscoreboard/users/other_views.py index 635e8881..b8dcbd59 100644 --- a/project/thscoreboard/users/other_views.py +++ b/project/thscoreboard/users/other_views.py @@ -1,4 +1,5 @@ """Defines views for user and account management.""" + # TODO: Separate views in different files and put in views/. from django.http import HttpResponseBadRequest diff --git a/requirements-dev.txt b/requirements-dev.txt index b0e227c7..7a79341f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -r requirements.txt -django-rosetta==0.9.9 -flake8==6.1.0 -python-dotenv==1.0.0 -black==23.7.0 +django-rosetta==0.10.0 +flake8==7.0.0 +python-dotenv==1.0.1 +black==24.1.1 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 14d5c16d..97a5da0b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ -bcrypt==4.0.1 -django==4.2.4 +bcrypt==4.1.2 +django==5.0.1 django-compressor==4.4 -django-sass-processor==1.2.2 -freezegun==1.2.2 -immutabledict==3.0.0 +django-sass-processor==1.4 +freezegun==1.4.0 +immutabledict==4.1.0 kaitaistruct==0.10 -libsass==0.22.0 +libsass==0.23.0 postgres==4.0 requests==2.31.0 tsadecode==0.6 -whitenoise==6.5.0 +whitenoise==6.6.0