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

build(deps): bump the deps group with 16 updates #326

Merged
merged 6 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions dff/context_storages/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
that developers can inherit from in order to create their own context storage solutions.
This class implements the basic functionality and can be extended to add additional features as needed.
"""

import asyncio
import importlib
import threading
Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This class is used to store and retrieve context data in a JSON. It allows the DFF to easily
store and retrieve context data.
"""

import asyncio
from typing import Hashable

Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
and environments. Additionally, MongoDB is highly scalable and can handle large amounts of data
and high levels of read and write traffic.
"""

from typing import Hashable, Dict, Any

try:
Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
It is efficient and fast, but it is not recommended to use it to transfer data across
different languages or platforms because it's not cross-language compatible.
"""

import asyncio
import pickle
from typing import Hashable
Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
The DFF supports a variety of communication protocols,
which allows it to communicate with different types of databases.
"""

import json
import pathlib

Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Additionally, Redis can be used as a cache, message broker, and database, making it a versatile
and powerful choice for data storage and management.
"""

import json
from typing import Hashable

Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/shelve.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
It stores data in a dbm-style format in the file system, which is not as fast as the other serialization
libraries like pickle or JSON.
"""

import pickle
from shelve import DbfilenameShelf
from typing import Hashable
Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
reliability and scalability. SQLite is a self-contained, high-reliability, embedded, full-featured,
public-domain, SQL database engine.
"""

import asyncio
import importlib
import json
Expand Down
1 change: 1 addition & 0 deletions dff/context_storages/ydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
with Yandex Cloud services using python. This allows the DFF to easily integrate with the Yandex DataBase and
take advantage of the scalability and high-availability features provided by the service.
"""

import asyncio
import os
from typing import Hashable
Expand Down
1 change: 1 addition & 0 deletions dff/messengers/common/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The Message Interfaces module contains several basic classes that define the message interfaces.
These classes provide a way to define the structure of the messengers that are used to communicate with the DFF.
"""

from __future__ import annotations
import abc
import asyncio
Expand Down
1 change: 1 addition & 0 deletions dff/messengers/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-----
The Types module contains special types that are used throughout the `DFF Messengers`.
"""

from typing import Callable
from typing_extensions import TypeAlias

Expand Down
1 change: 1 addition & 0 deletions dff/messengers/telegram/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This module implements various interfaces for :py:class:`~dff.messengers.telegram.messenger.TelegramMessenger`
that can be used to interact with the Telegram API.
"""

import asyncio
from typing import Any, Optional, List, Tuple, Callable

Expand Down
7 changes: 4 additions & 3 deletions dff/messengers/telegram/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
----------------
This module implements inherited classes :py:mod:`dff.script.core.message` modified for usage with Telegram.
"""

from typing import Optional, Union
from enum import Enum

Expand Down Expand Up @@ -67,9 +68,9 @@ class ParseMode(Enum):


class TelegramMessage(Message):
ui: Optional[
Union[TelegramUI, RemoveKeyboard, ReplyKeyboardRemove, ReplyKeyboardMarkup, InlineKeyboardMarkup]
] = None
ui: Optional[Union[TelegramUI, RemoveKeyboard, ReplyKeyboardRemove, ReplyKeyboardMarkup, InlineKeyboardMarkup]] = (
None
)
location: Optional[Location] = None
callback_query: Optional[Union[str, _ClickButton]] = None
update: Optional[
Expand Down
1 change: 1 addition & 0 deletions dff/messengers/telegram/messenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Using it, you can put Telegram update handlers inside your script and condition your transitions accordingly.

"""

from pathlib import Path
from typing import Union, List, Optional, Callable
from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions dff/messengers/telegram/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
------
This module contains utilities for connecting to Telegram.
"""

from typing import Union, Iterable
from contextlib import contextmanager
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
are attached should be executed or not.
The standard set of them allows user to setup dependencies between pipeline components.
"""

from __future__ import annotations
from typing import Optional, TYPE_CHECKING

Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/pipeline/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

.. figure:: /_static/drawio/dfe/user_actor.png
"""

from __future__ import annotations
import logging
import asyncio
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/pipeline/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
The PipelineComponent class can be a group or a service. It is designed to be reusable and composable,
allowing developers to create complex processing pipelines by combining multiple components.
"""

from __future__ import annotations
import logging
import abc
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class, which is defined in the Component module. Together, these classes provide a powerful and flexible way
to structure and manage the messages processing flow.
"""

import asyncio
import logging
from typing import Union, List, Dict, Optional, Hashable, Callable
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/pipeline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The Utils module contains several service functions that are commonly used throughout the framework.
These functions provide a variety of utility functionality.
"""

import collections
from typing import Union, List
from inspect import isfunction
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/service/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
beyond the core functionality. Extra handlers is an input converting addition to :py:class:`.PipelineComponent`.
For example, it is used to grep statistics from components, timing, logging, etc.
"""

from __future__ import annotations
import asyncio
import logging
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/service/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
allowing for easier management and organization of the services within the pipeline.
The :py:class:`~.ServiceGroup` serves the important function of grouping services to work together in parallel.
"""

from __future__ import annotations
import asyncio
import logging
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Service can be asynchronous only if its handler is a coroutine.
Actor wrapping service is asynchronous.
"""

from __future__ import annotations
import logging
import inspect
Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The Utility Functions module contains several utility functions that are commonly used throughout the DFF.
These functions provide a variety of utility functionality.
"""

import asyncio
from typing import Callable, Any, Optional, Tuple, Mapping

Expand Down
1 change: 1 addition & 0 deletions dff/pipeline/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The classes and special types in this module can include data models,
data structures, and other types that are defined for type hinting.
"""

from __future__ import annotations
from enum import unique, Enum
from typing import Callable, Union, Awaitable, Dict, List, Optional, Iterable, Any, Protocol, Hashable, TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions dff/script/conditions/std_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
These conditions can be used to check the current context, the user's input,
or other factors that may affect the conversation flow.
"""

from typing import Callable, Pattern, Union, List, Optional
import logging
import re
Expand Down
1 change: 1 addition & 0 deletions dff/script/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
The context can be easily serialized to a format that can be stored or transmitted, such as JSON.
This allows developers to save the context data and resume the conversation later.
"""

from __future__ import annotations
import logging
from uuid import UUID, uuid4
Expand Down
1 change: 1 addition & 0 deletions dff/script/core/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
They are used to determine all nodes in the script and to assign python objects and python functions for nodes.

"""

from enum import Enum


Expand Down
1 change: 1 addition & 0 deletions dff/script/core/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The :py:class:`.Message` class is a universal data model for representing a message that should be supported by
DFF. It only contains types and properties that are compatible with most messaging services.
"""

from typing import Any, Optional, List, Union
from enum import Enum, auto
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions dff/script/core/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
that is suitable for script and actor execution process.
This module contains a basic set of functions for normalizing data in a dialog script.
"""

from __future__ import annotations
import logging
from typing import Union, Callable, Optional, TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions dff/script/core/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
These models are used to define the conversation flow, and to determine the appropriate response based on
the user's input and the current state of the conversation.
"""

# %%
from __future__ import annotations
import logging
Expand Down
1 change: 1 addition & 0 deletions dff/script/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
The types defined in this module include basic data types such as strings
and lists, as well as more complex types that are specific to the framework.
"""

from typing import Union, Callable, Tuple
from enum import Enum, auto
from typing_extensions import TypeAlias
Expand Down
1 change: 1 addition & 0 deletions dff/script/labels/std_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
This module contains a standard set of scripting :py:const:`labels <dff.script.NodeLabelType>` that
can be used by developers to define the conversation flow.
"""

from __future__ import annotations
from typing import Optional, Callable, TYPE_CHECKING
from dff.script import Context, NodeLabel3Type
Expand Down
1 change: 1 addition & 0 deletions dff/script/responses/std_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
This module provides only one predefined response function that can be used to quickly
respond to the user and keep the conversation flowing.
"""

import random
from typing import List

Expand Down
1 change: 1 addition & 0 deletions dff/stats/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
--outfile=config_artifact.zip

"""

import sys
import argparse
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions dff/stats/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This modules defines commands that can be called via the command line interface.

"""

from uuid import uuid4
import tempfile
import shutil
Expand Down
1 change: 1 addition & 0 deletions dff/stats/default_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Detailed examples can be found in the `tutorials` section.

"""

from datetime import datetime

from dff.script import Context
Expand Down
1 change: 1 addition & 0 deletions dff/stats/instrumentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

For detailed reference, see `~OtelInstrumentor` class.
"""

import asyncio
from typing import Collection, Optional

Expand Down
1 change: 1 addition & 0 deletions dff/stats/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
set_tracer_destination(OTLPSpanExporter("grpc://localhost:4317", insecure=True))

"""

import json
import getpass
from urllib import parse
Expand Down
1 change: 1 addition & 0 deletions dff/utils/db_benchmark/basic_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
as well as a set of configurations that covers different dialogs a user might have and some edge-cases
(:py:data:`~.basic_configurations`).
"""

from typing import Tuple, Optional
import string
import random
Expand Down
1 change: 1 addition & 0 deletions dff/utils/db_benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:py:func:`~dff.utils.db_benchmark.report.report` or
`our streamlit app <../_misc/benchmark_streamlit.py>`_.
"""

from uuid import uuid4
from pathlib import Path
from time import perf_counter
Expand Down
9 changes: 6 additions & 3 deletions dff/utils/db_benchmark/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
--------
This method contains a function to print benchmark results to console.
"""

from pathlib import Path
from typing import Union, Set, Literal
import json
Expand Down Expand Up @@ -44,9 +45,11 @@ def report(
"config": "\n".join(f"{k}: {v}" for k, v in benchmark["benchmark_config"].items()),
"metrics": "".join(
[
f"{metric.title() + ': ' + str(benchmark['average_results']['pretty_' + metric]):20}"
if benchmark["success"]
else benchmark["result"]
(
f"{metric.title() + ': ' + str(benchmark['average_results']['pretty_' + metric]):20}"
if benchmark["success"]
else benchmark["result"]
)
for metric in ("write", "read", "update", "read+update")
]
),
Expand Down
1 change: 1 addition & 0 deletions dff/utils/testing/cleanup_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This module defines functions that allow to delete data in various types of databases,
including JSON, MongoDB, Pickle, Redis, Shelve, SQL, and YDB databases.
"""

import os

from dff.context_storages import (
Expand Down
1 change: 1 addition & 0 deletions dff/utils/testing/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
------
This module contains several functions which are used to run demonstrations in tutorials.
"""

from os import getenv
from typing import Callable, Tuple, Optional
from uuid import uuid4
Expand Down
1 change: 1 addition & 0 deletions dff/utils/testing/response_comparers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-----------------
This module defines function used to compare two response objects.
"""

from typing import Any, Optional

from dff.script import Context, Message
Expand Down
Loading
Loading