mirror of
https://github.com/ModOrganizer2/modorganizer-basic_games.git
synced 2026-07-27 14:07:29 -07:00
Bump dev dependencies and re-apply black. (#138)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
.mypy_cache
|
||||
__pycache__
|
||||
.venv
|
||||
venv
|
||||
.tox
|
||||
.vscode
|
||||
.idea
|
||||
|
||||
@@ -60,10 +60,12 @@ class BasicGameSaveGameInfoWidget(mobase.ISaveGameInfoWidget):
|
||||
def __init__(
|
||||
self,
|
||||
parent: QWidget | None,
|
||||
get_preview: Callable[[Path], QPixmap | QImage | Path | str | None]
|
||||
| None = lambda p: None,
|
||||
get_metadata: Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None]
|
||||
| None = get_filedate_metadata,
|
||||
get_preview: (
|
||||
Callable[[Path], QPixmap | QImage | Path | str | None] | None
|
||||
) = lambda p: None,
|
||||
get_metadata: (
|
||||
Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None] | None
|
||||
) = get_filedate_metadata,
|
||||
max_width: int = 320,
|
||||
):
|
||||
"""
|
||||
@@ -179,10 +181,12 @@ class BasicGameSaveGameInfo(mobase.SaveGameInfo):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
get_preview: Callable[[Path], QPixmap | QImage | Path | str | None]
|
||||
| None = None,
|
||||
get_metadata: Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None]
|
||||
| None = None,
|
||||
get_preview: (
|
||||
Callable[[Path], QPixmap | QImage | Path | str | None] | None
|
||||
) = None,
|
||||
get_metadata: (
|
||||
Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None] | None
|
||||
) = None,
|
||||
max_width: int = 0,
|
||||
):
|
||||
"""Args from: `BasicGameSaveGameInfoWidget`."""
|
||||
|
||||
+10
-8
@@ -120,7 +120,6 @@ class BasicGameMapping(Generic[_T]):
|
||||
|
||||
|
||||
class BasicGameOptionsMapping(BasicGameMapping[list[_T]]):
|
||||
|
||||
"""
|
||||
Represents a game mappings for which multiple options are possible. The game
|
||||
plugin is responsible to choose the right option depending on the context.
|
||||
@@ -269,9 +268,11 @@ class BasicGameMappings:
|
||||
"GameValidShortNames",
|
||||
"validShortNames",
|
||||
default=lambda g: [],
|
||||
apply_fn=lambda value: [c.strip() for c in value.split(",")] # type: ignore
|
||||
if isinstance(value, str)
|
||||
else value,
|
||||
apply_fn=lambda value: (
|
||||
[c.strip() for c in value.split(",")] # type: ignore
|
||||
if isinstance(value, str)
|
||||
else value
|
||||
),
|
||||
)
|
||||
self.nexusGameId = BasicGameMapping(
|
||||
game, "GameNexusId", "nexusGameID", default=lambda g: 0, apply_fn=int
|
||||
@@ -296,9 +297,11 @@ class BasicGameMappings:
|
||||
"GameIniFiles",
|
||||
"iniFiles",
|
||||
lambda g: [],
|
||||
apply_fn=lambda value: [c.strip() for c in value.split(",")]
|
||||
if isinstance(value, str)
|
||||
else value,
|
||||
apply_fn=lambda value: (
|
||||
[c.strip() for c in value.split(",")]
|
||||
if isinstance(value, str)
|
||||
else value
|
||||
),
|
||||
)
|
||||
self.savesDirectory = BasicGameMapping(
|
||||
game,
|
||||
@@ -371,7 +374,6 @@ _GameFeature = (
|
||||
|
||||
|
||||
class BasicGame(mobase.IPluginGame):
|
||||
|
||||
"""This class implements some methods from mobase.IPluginGame
|
||||
to make it easier to create game plugins without having to implement
|
||||
all the methods of mobase.IPluginGame."""
|
||||
|
||||
@@ -92,9 +92,9 @@ class DivinityOriginalSinEnhancedEditionGame(BasicGame, mobase.IPluginFileMapper
|
||||
self._featureMap[mobase.SaveGameInfo] = BasicGameSaveGameInfo(
|
||||
lambda s: s.with_suffix(".png")
|
||||
)
|
||||
self._featureMap[
|
||||
mobase.ModDataChecker
|
||||
] = DivinityOriginalSinEnhancedEditionModDataChecker()
|
||||
self._featureMap[mobase.ModDataChecker] = (
|
||||
DivinityOriginalSinEnhancedEditionModDataChecker()
|
||||
)
|
||||
return True
|
||||
|
||||
def mappings(self) -> list[mobase.Mapping]:
|
||||
|
||||
@@ -44,9 +44,9 @@ class GTASanAndreasDefinitiveEditionGame(BasicGame):
|
||||
|
||||
def init(self, organizer: mobase.IOrganizer) -> bool:
|
||||
super().init(organizer)
|
||||
self._featureMap[
|
||||
mobase.ModDataChecker
|
||||
] = GTASanAndreasDefinitiveEditionModDataChecker()
|
||||
self._featureMap[mobase.ModDataChecker] = (
|
||||
GTASanAndreasDefinitiveEditionModDataChecker()
|
||||
)
|
||||
return True
|
||||
|
||||
def executables(self):
|
||||
|
||||
@@ -44,9 +44,9 @@ class GTAViceCityDefinitiveEditionGame(BasicGame):
|
||||
|
||||
def init(self, organizer: mobase.IOrganizer) -> bool:
|
||||
super().init(organizer)
|
||||
self._featureMap[
|
||||
mobase.ModDataChecker
|
||||
] = GTAViceCitysDefinitiveEditionModDataChecker()
|
||||
self._featureMap[mobase.ModDataChecker] = (
|
||||
GTAViceCitysDefinitiveEditionModDataChecker()
|
||||
)
|
||||
return True
|
||||
|
||||
def executables(self):
|
||||
|
||||
@@ -31,9 +31,9 @@ class SubnauticaBelowZeroGame(game_subnautica.SubnauticaGame):
|
||||
|
||||
def init(self, organizer: mobase.IOrganizer) -> bool:
|
||||
super().init(organizer)
|
||||
self._featureMap[
|
||||
mobase.ModDataChecker
|
||||
] = game_subnautica.SubnauticaModDataChecker(
|
||||
GlobPatterns(unfold=["BepInExPack_BelowZero"])
|
||||
self._featureMap[mobase.ModDataChecker] = (
|
||||
game_subnautica.SubnauticaModDataChecker(
|
||||
GlobPatterns(unfold=["BepInExPack_BelowZero"])
|
||||
)
|
||||
)
|
||||
return True
|
||||
|
||||
Generated
+165
-160
File diff suppressed because it is too large
Load Diff
+9
-11
@@ -1,6 +1,5 @@
|
||||
# note: this file is for local development, currently the file is not used to build
|
||||
# the plugin
|
||||
|
||||
[tool.poetry]
|
||||
name = "basic-games"
|
||||
version = "0.1.0"
|
||||
@@ -17,16 +16,16 @@ lzokay = "1.1.5"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
mobase-stubs = { version = "^2.5.0.dev15", allow-prereleases = true }
|
||||
pyqt6 = "^6.5.2"
|
||||
pyright = "^1.1.327"
|
||||
flake8 = "^6.1.0"
|
||||
pyqt6 = "^6.6.1"
|
||||
pyright = "^1.1.350"
|
||||
flake8 = "^7.0.0"
|
||||
flake8-pyproject = "^1.2.3"
|
||||
ruff = "^0.0.291"
|
||||
mypy = "^1.5.1"
|
||||
isort = "^5.12.0"
|
||||
black = "^23.9.1"
|
||||
ruff = "^0.2.1"
|
||||
mypy = "^1.8.0"
|
||||
isort = "^5.13.2"
|
||||
black = "^24.2.0"
|
||||
flake8-black = "^0.3.6"
|
||||
types-psutil = "^5.9.5.16"
|
||||
types-psutil = "^5.9.5.20240205"
|
||||
poethepoet = "^0.23.0"
|
||||
|
||||
[build-system]
|
||||
@@ -39,7 +38,6 @@ lint-isort = "isort -c ."
|
||||
lint-mypy = "mypy ."
|
||||
lint-ruff = "ruff ."
|
||||
lint-pyright = "pyright ."
|
||||
|
||||
lint-all.sequence = [
|
||||
"lint-black",
|
||||
"lint-isort",
|
||||
@@ -78,7 +76,7 @@ line-length = 88
|
||||
target-version = "py311"
|
||||
|
||||
[tool.pyright]
|
||||
exclude = ["lib", "**/.*"]
|
||||
exclude = ["lib", "**/.*", "venv"]
|
||||
typeCheckingMode = "strict"
|
||||
pythonPlatform = "Windows"
|
||||
reportMissingModuleSource = false
|
||||
|
||||
Reference in New Issue
Block a user