Skip to content

Commit ff1f4eb

Browse files
committed
refactor: restructure project to a more logical structure
BREAKING CHANGE: Changed to use 'database', 'display', 'server', 'lib', and 'plugins' as the top level folder.
1 parent e18189b commit ff1f4eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+157
-77
lines changed

.vscode/launch.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@
99
"type": "debugpy",
1010
"request": "launch",
1111
"program": "${file}",
12-
"console": "integratedTerminal"
1312
},
1413
{
1514
"name": "Python Debugger: All Code",
1615
"type": "debugpy",
1716
"request": "launch",
1817
"program": "${file}",
19-
"console": "integratedTerminal",
2018
"justMyCode": false
19+
},
20+
{
21+
"name": "Python Debugger: Pytest",
22+
"type": "debugpy",
23+
"request": "launch",
24+
"module": "pytest",
25+
"args": ["${file}"]
2126
}
2227
]
2328
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"--doctest-modules",
1313
"src"
1414
],
15-
"python.testing.unittestEnabled": false,
15+
"python.testing.unittestEnabled": true,
1616
"[python]": {
1717
"editor.defaultFormatter": "charliermarsh.ruff",
1818
"editor.formatOnSave": true,

src/mastermind/core/controllers/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/mastermind/core/models/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from mastermind.database.game_repository import GameRepository
2+
from mastermind.database.models import (
3+
Game,
4+
GameBoard,
5+
GameConfiguration,
6+
GameEntities,
7+
GameMode,
8+
GameRound,
9+
GameState,
10+
get_winner,
11+
)
12+
13+
__all__ = [
14+
"GameRepository",
15+
"Game",
16+
"GameConfiguration",
17+
"GameEntities",
18+
"GameMode",
19+
"GameRound",
20+
"GameState",
21+
"GameBoard",
22+
"get_winner",
23+
]

src/mastermind/libs/storage/game_repository.py renamed to src/mastermind/database/game_repository.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
from appdirs import user_data_dir # type: ignore
44

5-
from mastermind.core.models.game import Game
6-
from mastermind.libs.storage.json_multifiles_io_handler import JsonMultiFilesIOHandler
7-
from mastermind.libs.storage.repository import Repository
5+
from mastermind.database.libs import (
6+
JsonMultiFilesIOHandler,
7+
Repository,
8+
)
9+
from mastermind.database.models import Game
810

911

1012
class GameRepository(Repository[Game]):
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from mastermind.database.libs.io_handler import IOHandler
2+
from mastermind.database.libs.json_multifiles_io_handler import (
3+
JsonMultiFilesIOHandler,
4+
)
5+
from mastermind.database.libs.repository import Repository
6+
7+
__all__ = [
8+
"IOHandler",
9+
"JsonMultiFilesIOHandler",
10+
"Repository",
11+
]
File renamed without changes.

src/mastermind/libs/storage/json_multifiles_io_handler.py renamed to src/mastermind/database/libs/json_multifiles_io_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from dataclasses_json import DataClassJsonMixin
55

6-
from mastermind.libs.storage.io_handler import IOHandler
6+
from mastermind.database.libs.io_handler import IOHandler
77

88
JsonSerializable = TypeVar("JsonSerializable", bound="DataClassJsonMixin")
99

src/mastermind/libs/storage/repository.py renamed to src/mastermind/database/libs/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from shortuuid import ShortUUID
55

6-
from mastermind.libs.storage.io_handler import IOHandler
6+
from mastermind.database.libs.io_handler import IOHandler
77

88
T = TypeVar("T")
99

0 commit comments

Comments
 (0)