Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#71 edit scn by hints #107

Merged
merged 35 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
256fc7e
render from jinja
bomzheg Jul 30, 2024
e562598
added dialog for hint edit
bomzheg Jul 30, 2024
f4c32e4
added select any hint
bomzheg Aug 23, 2024
6c1cfd9
added select any hint
bomzheg Aug 23, 2024
075be45
added todo
bomzheg Aug 23, 2024
b33ef55
added time_hint domain logic
bomzheg Aug 31, 2024
b8fdf4a
save time
bomzheg Aug 31, 2024
737a496
added HintsList
bomzheg Sep 5, 2024
b5b0337
migrate to adaptix for scn-models dump-restore
bomzheg Oct 4, 2024
1236768
tries to use correct way
bomzheg Oct 4, 2024
0531c40
use abcproxy
bomzheg Oct 4, 2024
be72d37
fixed tests
bomzheg Oct 4, 2024
8d8705c
fixed tests
bomzheg Oct 5, 2024
dcd0df9
fixed for linter
bomzheg Oct 5, 2024
d2b0f90
fixed bot
bomzheg Oct 6, 2024
1526ce8
few renames
bomzheg Oct 6, 2024
3bccc07
added render transitions
bomzheg Oct 6, 2024
2572e9e
added levels transitions
bomzheg Oct 6, 2024
b361e84
output dir
bomzheg Oct 6, 2024
f4efede
added transitions
bomzheg Oct 6, 2024
87cfd1e
added publish ci
bomzheg Oct 6, 2024
9d60444
fixed publish ci
bomzheg Oct 6, 2024
0462d0f
added tools to test deps
bomzheg Oct 6, 2024
3079124
added tools to test deps
bomzheg Oct 6, 2024
4f659bb
added tools to test deps
bomzheg Oct 6, 2024
06940e9
added /levels command
bomzheg Oct 6, 2024
d9be11b
added save edited hint
bomzheg Oct 6, 2024
cf6f23b
its work?
bomzheg Oct 6, 2024
f1cd5c4
fixed show hint for edit method
bomzheg Oct 6, 2024
2747ee0
migrate select to ListGroup
bomzheg Oct 6, 2024
230233a
added delete hint part button
bomzheg Oct 6, 2024
d7a3d22
added delete hint part button
bomzheg Oct 6, 2024
7a64c80
Merge branch 'master' into feature/#71
bomzheg Oct 6, 2024
5fb39d6
added add hint parts
bomzheg Oct 6, 2024
831282e
added add hint parts
bomzheg Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,29 @@ jobs:
run: uv venv && uv pip install .[test]
- name: Test with pytest
run: source .venv/bin/activate && pytest
docs:
needs: [build]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install uv
run: pipx install uv
- name: Install graphviz
run: sudo apt install -y graphviz
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: uv venv && uv pip install .[test]
- name: Render Aiogram-dialogs transitions
run: source .venv/bin/activate && python -m shvatka.tgbot.dialogs.__init__
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: transitions
path: out/shvatka-dialogs.png

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ dmypy.json
/config/
/files/
/local-storage/
/out/

#pyro stuff
*.session
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ test = [
"mypy>=1.1.1,<2.0",
"aiogram-tests @ git+https://github.com/bomzheg/aiogram_tests.git@fix/aiogram3rc",
"asgi-lifespan>=2.1.0,<3.0",
"aiogram_dialog[tools]>=2.1,<2.2",
]

[project.scripts]
Expand Down
7 changes: 5 additions & 2 deletions shvatka/api/models/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
from datetime import datetime
from typing import Sequence, Generic

from adaptix import Retort, dumper

from shvatka.core.games.dto import CurrentHints
from shvatka.core.models import dto, enums
from shvatka.core.models.dto import scn
from shvatka.core.models.enums import GameStatus

T = typing.TypeVar("T")
retort = Retort(recipe=[dumper(scn.HintsList, lambda x: x.hints)])


@dataclass
Expand Down Expand Up @@ -76,7 +79,7 @@ class Level:
db_id: int
name_id: str
author: Player
scenario: scn.LevelScenario
scenario: dict[str, typing.Any]
game_id: int | None = None
number_in_game: int | None = None

Expand All @@ -88,7 +91,7 @@ def from_core(cls, core: dto.Level | None = None):
db_id=core.db_id,
name_id=core.name_id,
author=Player.from_core(core.author),
scenario=core.scenario,
scenario=retort.dump(core.scenario),
game_id=core.game_id,
number_in_game=core.number_in_game,
)
Expand Down
Loading