Some small updates.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2023-09-22 00:18:02 +04:00
parent d9e0285bb3
commit a28019a8c8
7 changed files with 857 additions and 1173 deletions

11
.flake8
View File

@ -65,6 +65,11 @@ ignore =
; Found function with too much cognitive complexity ; Found function with too much cognitive complexity
WPS231, WPS231,
per-file-ignores =
; all tests
test_*.py,tests.py,tests_*.py,*/tests/*:
; Use of assert detected
S101,
; all init files ; all init files
__init__.py: __init__.py:
; ignore not used imports ; ignore not used imports
@ -74,12 +79,6 @@ ignore =
; Found wrong metadata variable ; Found wrong metadata variable
WPS410, WPS410,
per-file-ignores =
; all tests
test_*.py,tests.py,tests_*.py,*/tests/*:
; Use of assert detected
S101,
exclude = exclude =
./.git, ./.git,
./venv, ./venv,

View File

@ -42,4 +42,3 @@ deploy:
--namespace "$NAMESPACE" --namespace "$NAMESPACE"
-f "$HELM_CONFIG" -f "$HELM_CONFIG"
--set "podAnnotations.deployed_at=$(date +%Y.%m.%d-%H:%M)" --set "podAnnotations.deployed_at=$(date +%Y.%m.%d-%H:%M)"

View File

@ -12,7 +12,7 @@ repos:
- repo: https://github.com/asottile/add-trailing-comma - repo: https://github.com/asottile/add-trailing-comma
rev: v2.1.0 rev: v2.1.0
hooks: hooks:
- id: add-trailing-comma - id: add-trailing-comma
- repo: local - repo: local
hooks: hooks:
@ -26,38 +26,46 @@ repos:
name: autoflake name: autoflake
entry: autoflake entry: autoflake
language: system language: system
types: [ python ] types: [python]
args: [ --in-place, --remove-all-unused-imports, --remove-duplicate-keys ] args:
[
--in-place,
--remove-all-unused-imports,
--remove-duplicate-keys,
--recursive,
lenochka,
]
- id: isort - id: isort
name: isort name: isort
entry: isort entry: isort
language: system language: system
types: [ python ] types: [python]
- id: flake8 - id: flake8
name: Check with Flake8 name: Check with Flake8
entry: flake8 entry: flake8
language: system language: system
pass_filenames: false pass_filenames: false
types: [ python ] types: [python]
args: [--count, .] args: [--count, lenochka]
- id: mypy - id: mypy
name: Validate types with MyPy name: Validate types with MyPy
entry: mypy entry: mypy
language: system language: system
types: [ python ] pass_filenames: false
args: [lenochka]
- id: yesqa - id: yesqa
name: Remove usless noqa name: Remove usless noqa
entry: yesqa entry: yesqa
language: system language: system
types: [ python ] types: [python]
- id: pytest - id: pytest
name: pytest name: pytest
entry: pytest entry: pytest
language: system language: system
pass_filenames: false pass_filenames: false
types: [ python ] types: [python]

View File

@ -1,8 +1,6 @@
import re import re
import secrets
from typing import Optional from typing import Optional
MAX_TRIGGER_WORDS = 3 MAX_TRIGGER_WORDS = 3
WORD_PATTERN = re.compile(r"(\w+)") WORD_PATTERN = re.compile(r"(\w+)")

View File

@ -8,7 +8,10 @@ class Memory(BaseSettings):
It holds the most important things for lenochka's life. It holds the most important things for lenochka's life.
""" """
token: str = Field(env="LENOCHKA_INSTAGRAM_ID", required=True) token: str = Field(..., env="LENOCHKA_INSTAGRAM_ID")
class Config:
env_file = ".env"
memory = Memory() memory = Memory() # type: ignore

1961
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -9,21 +9,21 @@ python = "^3.9"
aiogram = "^2.13" aiogram = "^2.13"
pydantic = "^1.8.2" pydantic = "^1.8.2"
[tool.poetry.dev-dependencies]
pytest = "^5.2"
black = "^21.5b2"
isort = "^5.8.0"
wemake-python-styleguide = "^0.15.2"
flake8 = "^3.9.2"
mypy = "^0.812"
yesqa = "^1.2.3"
autoflake = "^1.4"
pytest-env = "^0.6.2"
pytest-cov = "^2.12.1"
[tool.poetry.scripts] [tool.poetry.scripts]
lenochka_wake_up = "lenochka.mouth:talk_to_the_wind" lenochka_wake_up = "lenochka.mouth:talk_to_the_wind"
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.2"
black = "^23.9.1"
isort = "^5.12.0"
flake8 = "^6.1.0"
mypy = "^1.5.1"
yesqa = "^1.5.0"
pytest-env = "^1.0.1"
pytest-cov = "^4.1.0"
autoflake = "^2.2.1"
[build-system] [build-system]
requires = ["poetry-core>=1.0.0"] requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"