Maintenance

This commit is contained in:
Taras Terletsky 2024-04-09 22:09:33 +03:00
parent d344008c2b
commit 32e9b92eeb
7 changed files with 13 additions and 9 deletions

View file

@ -13,4 +13,4 @@
**/*Dockerfile*
LICENSE
README.md
.ruff.toml
pyproject.toml

View file

@ -1,5 +1,4 @@
PyYAML==6.0.1
addict==2.4.0
pyrofork==2.3.21.post3
tenacity==8.2.3
tgcrypto-pyrofork==1.2.6

View file

@ -53,7 +53,7 @@ class EncodeToH264Task(AbstractFfBinaryTask):
proc = await self._run_proc(cmd)
if not proc:
return None
return
stdout, stderr = await self._get_stdout_stderr(proc)
self._log.info(

View file

@ -1,11 +1,15 @@
[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py312"
src = ["app_api", "app_bot", "app_worker"]
required-version = ">=0.3.4"
[lint]
select = ["F", "E", "W", "I001"]
[tool.ruff.lint]
select = ["F", "E", "W", "I001", "RET", "SLF001"]
ignore = ["E501"] # Skip line length violations
[format]
[tool.ruff.format]
indent-style = "space"
quote-style = "single"
line-ending = "lf"

View file

@ -24,6 +24,7 @@ setup(
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
description='Common shared utils for yt downloader bot',
install_requires=get_requirements(),

View file

@ -5,7 +5,7 @@ import aiohttp
from yt_shared.schemas.ytdlp import LatestVersion
class YtDlpGithubClient:
class YtdlpGithubClient:
"""yt-dlp Github version number checker."""
LATEST_TAG_URL = 'https://github.com/yt-dlp/yt-dlp/releases/latest'

View file

@ -2,7 +2,7 @@ import asyncio
import logging
from sqlalchemy.ext.asyncio import AsyncSession
from yt_shared.clients.github import YtDlpGithubClient
from yt_shared.clients.github import YtdlpGithubClient
from yt_shared.repositories.ytdlp import YtdlpRepository
from yt_shared.schemas.ytdlp import CurrentVersion, LatestVersion, VersionContext
@ -15,7 +15,7 @@ class YtdlpVersionChecker:
def __init__(self) -> None:
self._log = logging.getLogger(self.__class__.__name__)
self._ytdlp_repository = YtdlpRepository()
self._ytdlp_client = YtDlpGithubClient()
self._ytdlp_client = YtdlpGithubClient()
async def get_version_context(self, db: AsyncSession) -> VersionContext:
latest, current = await asyncio.gather(