1
0
mirror of synced 2025-01-31 12:13:49 +01:00

Fix latest flake completely broken, fix latest typing issues.

This commit is contained in:
Jennifer Taylor 2022-08-13 17:17:51 +00:00
parent 2ebf59e541
commit 4f6d48fe45
17 changed files with 20 additions and 19 deletions

View File

@ -4,7 +4,7 @@ import traceback
from typing import Callable, Dict, Any, Optional, List from typing import Callable, Dict, Any, Optional, List
from react.jsx import JSXTransformer # type: ignore from react.jsx import JSXTransformer # type: ignore
from flask import Flask, flash, request, redirect, Response, url_for, render_template, got_request_exception, jsonify as flask_jsonify from flask import Flask, flash, request, redirect, Response, url_for, render_template, got_request_exception, jsonify as flask_jsonify
from flask_caching import Cache # type: ignore from flask_caching import Cache
from functools import wraps from functools import wraps
from bemani.common import AESCipher, GameConstants from bemani.common import AESCipher, GameConstants

View File

@ -1,9 +1,9 @@
# vim: set fileencoding=utf-8 # vim: set fileencoding=utf-8
import copy import copy
from abc import ABC from abc import ABC
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, cast
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.common import GameConstants, Profile, ValidatedDict, ID from bemani.common import GameConstants, Profile, ValidatedDict, ID
from bemani.data import Data, Config, Score, Attempt, Link, Song, UserID, RemoteUser from bemani.data import Data, Config, Score, Attempt, Link, Song, UserID, RemoteUser
@ -108,7 +108,8 @@ class FrontendBase(ABC):
if not force_db_load: if not force_db_load:
cached_songs = self.cache.get(f'{self.game.value}.sorted_songs') cached_songs = self.cache.get(f'{self.game.value}.sorted_songs')
if cached_songs is not None: if cached_songs is not None:
return cached_songs # Not sure why mypy insists that this is a str instead of Any.
return cast(Dict[int, Dict[str, Any]], cached_songs)
# Find all songs in the game, process notecounts and difficulties # Find all songs in the game, process notecounts and difficulties
songs: Dict[int, Dict[str, Any]] = {} songs: Dict[int, Dict[str, Any]] = {}

View File

@ -2,7 +2,7 @@
import copy import copy
from typing import Any, Dict, Iterator, Tuple from typing import Any, Dict, Iterator, Tuple
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.backend.bishi import BishiBashiFactory from bemani.backend.bishi import BishiBashiFactory
from bemani.common import Profile, ValidatedDict, ID, GameConstants from bemani.common import Profile, ValidatedDict, ID, GameConstants

View File

@ -1,4 +1,4 @@
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data from bemani.data import Config, Data
from bemani.frontend.app import app from bemani.frontend.app import app

View File

@ -1,4 +1,4 @@
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data from bemani.data import Config, Data
from bemani.frontend.app import app from bemani.frontend.app import app

View File

@ -1,7 +1,7 @@
# vim: set fileencoding=utf-8 # vim: set fileencoding=utf-8
from typing import Any, Dict, Iterator, Optional, Tuple, List from typing import Any, Dict, Iterator, Optional, Tuple, List
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.backend.iidx import IIDXFactory, IIDXBase from bemani.backend.iidx import IIDXFactory, IIDXBase
from bemani.common import Profile, ValidatedDict, GameConstants, RegionConstants from bemani.common import Profile, ValidatedDict, GameConstants, RegionConstants

View File

@ -1,4 +1,4 @@
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data from bemani.data import Config, Data
from bemani.frontend.app import app from bemani.frontend.app import app

View File

@ -2,7 +2,7 @@
import copy import copy
from typing import Any, Dict, Iterator, Tuple from typing import Any, Dict, Iterator, Tuple
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.backend.mga import MetalGearArcadeFactory from bemani.backend.mga import MetalGearArcadeFactory
from bemani.common import Profile, ValidatedDict, ID, GameConstants from bemani.common import Profile, ValidatedDict, ID, GameConstants

View File

@ -1,4 +1,4 @@
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data from bemani.data import Config, Data
from bemani.frontend.app import app from bemani.frontend.app import app

View File

@ -1,7 +1,7 @@
# vim: set fileencoding=utf-8 # vim: set fileencoding=utf-8
from typing import Any, Dict, Iterator, List, Tuple from typing import Any, Dict, Iterator, List, Tuple
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.backend.museca import MusecaFactory, MusecaBase from bemani.backend.museca import MusecaFactory, MusecaBase
from bemani.common import GameConstants, VersionConstants, DBConstants, Profile, ValidatedDict from bemani.common import GameConstants, VersionConstants, DBConstants, Profile, ValidatedDict

View File

@ -1,4 +1,4 @@
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data from bemani.data import Config, Data
from bemani.frontend.app import app from bemani.frontend.app import app

View File

@ -1,4 +1,4 @@
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data from bemani.data import Config, Data
from bemani.frontend.app import app from bemani.frontend.app import app

View File

@ -1,7 +1,7 @@
# vim: set fileencoding=utf-8 # vim: set fileencoding=utf-8
from typing import Any, Dict, Iterator, List, Tuple from typing import Any, Dict, Iterator, List, Tuple
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.backend.reflec import ReflecBeatFactory, ReflecBeatBase from bemani.backend.reflec import ReflecBeatFactory, ReflecBeatBase
from bemani.common import GameConstants, Profile, ValidatedDict from bemani.common import GameConstants, Profile, ValidatedDict

View File

@ -1,4 +1,4 @@
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data from bemani.data import Config, Data
from bemani.frontend.app import app from bemani.frontend.app import app

View File

@ -1,7 +1,7 @@
# vim: set fileencoding=utf-8 # vim: set fileencoding=utf-8
from typing import Any, Dict, Iterator, List, Tuple from typing import Any, Dict, Iterator, List, Tuple
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.backend.sdvx import SoundVoltexFactory, SoundVoltexBase from bemani.backend.sdvx import SoundVoltexFactory, SoundVoltexBase
from bemani.common import GameConstants, Profile, ValidatedDict from bemani.common import GameConstants, Profile, ValidatedDict

View File

@ -3,7 +3,7 @@ from typing import Optional, TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from flask.ctx import _AppCtxGlobals from flask.ctx import _AppCtxGlobals
from flask_caching import Cache # type: ignore from flask_caching import Cache
from bemani.data import Config, Data, UserID from bemani.data import Config, Data, UserID

View File

@ -15,7 +15,7 @@ types-Werkzeug
types-Flask types-Flask
types-freezegun types-freezegun
types-python-dateutil types-python-dateutil
flake8 flake8==4.0.1
typed-ast typed-ast
freezegun freezegun
pyreact pyreact