Skip to content

Commit 96f25d5

Browse files
authored
Merge pull request #38 from emptybutton/dev
chore: pull stable 0.3.0 changes
2 parents 4bd1f46 + 1ff29bd commit 96f25d5

File tree

175 files changed

+5059
-3553
lines changed

Some content is hidden

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

175 files changed

+5059
-3553
lines changed

deploy/dev/docker-compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ services:
9999

100100
volumes:
101101
backend-data:
102-
name: "ttt-dev-postgres-backend-data"
102+
name: "ttt-dev-backend-data"
103103
postgres-data:
104-
name: "ttt-dev-postgres-postgres-data"
104+
name: "ttt-dev-postgres-data"
105105
redis-data:
106-
name: "ttt-dev-postgres-redis-data"
106+
name: "ttt-dev-redis-data"
107107
nats-data:
108-
name: "ttt-dev-postgres-nats-data"
108+
name: "ttt-dev-nats-data"
109109

110110
secrets:
111111
secrets:

deploy/prod/.env.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ POSTGRES_REPLICA_PASSWORD=replica
66
NATS_TOKEN=nats
77

88
GEMINI_URL=https://my-gemini.vercel.app
9-
10-
GRAFANA_ADMIN_PASSWORD=grafana

deploy/prod/alloy/config.alloy

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

deploy/prod/docker-compose.yaml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -155,57 +155,6 @@ services:
155155
entrypoint: [""]
156156
command: ["bash", "/mnt/add_streams.sh"]
157157

158-
alloy:
159-
image: grafana/alloy:v1.10.0
160-
container_name: ttt-alloy
161-
volumes:
162-
- ./alloy/config.alloy:/etc/alloy/config.alloy
163-
- /var/run/docker.sock:/var/run/docker.sock
164-
networks:
165-
- loki
166-
command: run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
167-
depends_on:
168-
- loki
169-
170-
loki:
171-
image: grafana/loki:3.4.5
172-
container_name: ttt-loki
173-
environment:
174-
TZ: ${SYSTEM_TIMEZONE:-Europe/Moscow}
175-
volumes:
176-
- loki-data:/loki
177-
- ./loki/loki-config.yaml:/etc/loki/local-config.yaml
178-
networks:
179-
- loki
180-
command: -config.file=/etc/loki/local-config.yaml
181-
182-
grafana:
183-
image: grafana/grafana:12.0.2-ubuntu
184-
container_name: ttt-grafana
185-
environment:
186-
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
187-
- GF_FEATURE_TOGGLES_ENABLE=grafanaManagedRecordingRules
188-
189-
- GF_AUTH_ANONYMOUS_ENABLED=false
190-
- GF_AUTH_BASIC_ENABLED=true
191-
192-
- GF_SECURITY_FORCE_PASSWORD_CHANGE=true
193-
- GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION=false
194-
- GF_SECURITY_ADMIN_USER=admin
195-
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
196-
- GF_SECURITY_MIN_PASSWORD_LENGTH=4
197-
198-
- GF_USERS_ALLOW_SIGN_UP=false
199-
200-
- TZ=${SYSTEM_TIMEZONE:-Europe/Moscow}
201-
ports:
202-
- 3000:3000
203-
volumes:
204-
- grafana-data:/var/lib/grafana
205-
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
206-
networks:
207-
- loki
208-
209158
volumes:
210159
postgres-replica1-data:
211160
name: "ttt-prod-postgres-replica1-data"
@@ -215,16 +164,11 @@ volumes:
215164
name: "ttt-prod-redis-data"
216165
nats-data:
217166
name: "ttt-prod-nats-data"
218-
loki-data:
219-
name: "ttt-prod-loki-data"
220-
grafana-data:
221-
name: "ttt-prod-grafana-data"
222167

223168
networks:
224169
postgres: null
225170
redis: null
226171
nats: null
227-
loki: null
228172

229173
secrets:
230174
secrets:

deploy/prod/grafana/provisioning/datasources/loki.yaml

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

deploy/prod/loki/loki-config.yaml

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

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ttt"
3-
version = "0.1.1"
3+
version = "0.3.0"
44
description = "Tic-Tac-Toe Telegram Bot"
55
authors = [
66
{name = "Alexander Smolin", email = "[email protected]"}
@@ -20,6 +20,7 @@ dependencies = [
2020
"pydantic==2.10.6",
2121
"pydantic-settings[yaml]==2.9.1",
2222
"aiogram==3.20.0.post0",
23+
"aiogram-dialog==2.4.0",
2324
"nats-py[nkeys]==2.10.0",
2425
"openai==1.97.0",
2526
"structlog==25.4.0",
@@ -48,8 +49,8 @@ build-backend = "hatchling.build"
4849
packages = ["src/ttt"]
4950

5051
[project.scripts]
51-
ttt = "ttt.main.aiogram_slim.__main__:main"
52-
ttt-dev = "ttt.main.aiogram_dev.__main__:main"
52+
ttt = "ttt.main.tg_bot_prod.__main__:main"
53+
ttt-dev = "ttt.main.tg_bot_dev.__main__:main"
5354

5455
[tool.uv]
5556
add-bounds = "exact"
@@ -106,9 +107,11 @@ ignore = [
106107
"TC006",
107108
"EM101",
108109
"N807",
110+
"FURB118",
109111
]
110112

111113
[tool.ruff.lint.per-file-ignores]
114+
"src/ttt/infrastructure/sqlalchemy/tables/__init__.py" = ["F401"]
112115
"src/ttt/infrastructure/adapters/*" = ["ARG002"]
113116
"src/ttt/presentation/adapters/*" = ["ARG002"]
114117
"src/ttt/presentation/*" = ["RUF001"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from abc import ABC, abstractmethod
2+
3+
4+
class InvalidFsmStateError(Exception): ...
5+
6+
7+
class Fsm[StateT](ABC):
8+
@abstractmethod
9+
async def state(self, type_: type[StateT]) -> None:
10+
"""
11+
:raises ttt.application.common.ports.InvalidFsmStateError:
12+
"""
13+
14+
@abstractmethod
15+
async def set(self, state: StateT | None) -> None: ...

src/ttt/application/game/common/ports/game_views.py

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

0 commit comments

Comments
 (0)