Compare commits

...

5 Commits

Author SHA1 Message Date
Luna b17e0155ed schemas: add message_create.mobile_network_type 2023-11-18 19:22:41 -03:00
Luna 94a973f264 gateway.schemas: add hello.properties.app_arch 2023-11-18 19:14:40 -03:00
Luna 61f2163049 update main dependencies, fix latest quart 2023-11-18 19:04:21 -03:00
Luna d853073114 update dependencies, formatter run 2023-11-18 18:56:33 -03:00
Luna 84e2b5f1a9 add .tox to ci cache 2023-11-18 18:49:31 -03:00
13 changed files with 996 additions and 1070 deletions

View File

@ -10,6 +10,7 @@ services:
cache: cache:
paths: paths:
- .cache/pip - .cache/pip
- .tox
tests: tests:
before_script: before_script:

View File

@ -92,7 +92,6 @@ async def _resize(image, attach_id: int, ext: str, width: int, height: int) -> s
"/attachments" "/<int:channel_id>/<int:message_id>/<filename>", methods=["GET"] "/attachments" "/<int:channel_id>/<int:message_id>/<filename>", methods=["GET"]
) )
async def _get_attachment(channel_id: int, message_id: int, filename: str): async def _get_attachment(channel_id: int, message_id: int, filename: str):
attach_id = await app.db.fetchval( attach_id = await app.db.fetchval(
""" """
SELECT id SELECT id

View File

@ -157,7 +157,6 @@ def emoji_sql(
where_ext = f"AND emoji_id = {param}" where_ext = f"AND emoji_id = {param}"
main_emoji = emoji_id main_emoji = emoji_id
elif emoji_type == EmojiType.UNICODE: elif emoji_type == EmojiType.UNICODE:
# fun fact, emojis are length 1 in python? i'll use this to the # fun fact, emojis are length 1 in python? i'll use this to the
# best of my ability, lol # best of my ability, lol
if len(emoji_name) != 1: if len(emoji_name) != 1:

View File

@ -363,7 +363,6 @@ async def _process_overwrites(guild_id: int, channel_id: int, overwrites: list)
user_ids: List[int] = [] user_ids: List[int] = []
for overwrite in overwrites: for overwrite in overwrites:
# 0 for member overwrite, 1 for role overwrite # 0 for member overwrite, 1 for role overwrite
target_type = 0 if overwrite["type"] == "member" else 1 target_type = 0 if overwrite["type"] == "member" else 1
target_role = None if target_type == 0 else overwrite["id"] target_role = None if target_type == 0 else overwrite["id"]

View File

@ -150,7 +150,6 @@ async def _specific_chan_create(channel_id, ctype, **kwargs):
async def _subscribe_users_new_channel(guild_id: int, channel_id: int) -> None: async def _subscribe_users_new_channel(guild_id: int, channel_id: int) -> None:
# for each state currently subscribed to guild, we check on the database # for each state currently subscribed to guild, we check on the database
# which states can also subscribe to the new channel at its creation. # which states can also subscribe to the new channel at its creation.

View File

@ -106,6 +106,7 @@ IDENTIFY_SCHEMA = {
"required": False, "required": False,
"nullable": True, "nullable": True,
}, },
"app_arch": {"type": "string", "required": False},
}, },
}, },
"capabilities": {"type": "number", "required": False}, "capabilities": {"type": "number", "required": False},

View File

@ -552,7 +552,6 @@ class GuildMemberList:
# NOTE: maybe use map()? # NOTE: maybe use map()?
for group, member_ids in self.list: for group, member_ids in self.list:
# do not send information on groups # do not send information on groups
# that don't have anyone # that don't have anyone
if not member_ids: if not member_ids:

View File

@ -455,6 +455,7 @@ MESSAGE_CREATE = {
}, },
}, },
"flags": {"type": "number", "required": False}, "flags": {"type": "number", "required": False},
"mobile_network_type": {"type": "string", "required": False},
} }

View File

@ -225,7 +225,7 @@ async def maybe_lazy_guild_dispatch(
if isinstance(role, dict) and not role["hoist"] and not force: if isinstance(role, dict) and not role["hoist"] and not force:
return return
await (getattr(app.lazy_guild, event))(guild_id, role) await getattr(app.lazy_guild, event)(guild_id, role)
def extract_limit(request_, default: int = 50, max_val: int = 100): def extract_limit(request_, default: int = 50, max_val: int = 100):

2023
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -9,15 +9,15 @@ license = "GPLv3-only"
python = "^3.9" python = "^3.9"
bcrypt = "^4.0.1" bcrypt = "^4.0.1"
itsdangerous = "^2.1.2" itsdangerous = "^2.1.2"
asyncpg = "^0.27.0" asyncpg = "^0.29.0"
websockets = "^11.0.3" websockets = "^12.0"
Earl-ETF = "^2.1.2" Earl-ETF = "^2.1.2"
logbook = "^1.5.3" logbook = "^1.5.3"
Cerberus = "^1.3.4" Cerberus = "^1.3.5"
quart = "^0.18.4" quart = "^0.19.3"
pillow = "^9.5.0" pillow = "^10.1.0"
aiohttp = "^3.8.4" aiohttp = "^3.9.0"
zstandard = "^0.21.0" zstandard = "^0.22.0"
winter = {git = "https://gitlab.com/elixire/winter"} winter = {git = "https://gitlab.com/elixire/winter"}
wsproto = "^1.2.0" wsproto = "^1.2.0"

5
run.py
View File

@ -201,12 +201,15 @@ def set_blueprints(app_):
for bp, suffix in bps.items(): for bp, suffix in bps.items():
for prefix in PREFIXES: for prefix in PREFIXES:
version = int(prefix.split("v")[1])
url_prefix = f'{prefix}{suffix or ""}' url_prefix = f'{prefix}{suffix or ""}'
if suffix == -1: if suffix == -1:
url_prefix = "" url_prefix = ""
app_.register_blueprint(bp, url_prefix=url_prefix) app_.register_blueprint(
bp, name=f"v{version}.{bp.name}", url_prefix=url_prefix
)
app = make_app() app = make_app()

14
tox.ini
View File

@ -5,13 +5,13 @@ isolated_build = true
[testenv] [testenv]
ignore_errors = true ignore_errors = true
deps = deps =
pytest==7.1.2 pytest==7.4.3
pytest-asyncio==0.19.0 pytest-asyncio==0.21.1
pytest-cov==3.0.0 pytest-cov==4.1.0
flake8==5.0.4 flake8==6.1.0
black==22.6.0 black==23.11.0
mypy==0.971 mypy==1.7.0
pytest-instafail==0.4.2 pytest-instafail==0.5.0
commands = commands =
python3 ./manage.py migrate python3 ./manage.py migrate
black --check litecord run.py tests manage black --check litecord run.py tests manage