From 1028c8b563cfa1c1a9d5826ca9dcb7930d400efe Mon Sep 17 00:00:00 2001 From: Jack Collins <6640905+jackmpcollins@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:01:15 -0800 Subject: [PATCH] Use Ellipses in functions with docstrings (#109) * Ignore unnecessary ... error * Add back ... to functions with docstring --- pyproject.toml | 1 + tests/test_chatprompt.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 1032b100..27dcb91d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,7 @@ ignore = [ "COM", # flake8-commas "FA", # flake8-future-annotations "INP", # flake8-no-pep420 +"PIE790", # flake8-pie: Unnecessary `...` literal "SLF", # flake8-self "ARG", # flake8-unused-arguments "TD", # flake8-todos diff --git a/tests/test_chatprompt.py b/tests/test_chatprompt.py index 3b83a736..fd651831 100644 --- a/tests/test_chatprompt.py +++ b/tests/test_chatprompt.py @@ -95,6 +95,7 @@ def test_chatprompt_decorator_docstring(): @chatprompt(UserMessage("This is a user message.")) def func(one: int) -> str: """This is the docstring.""" + ... assert isinstance(func, ChatPromptFunction) assert getdoc(func) == "This is the docstring." @@ -127,6 +128,7 @@ async def test_async_chatprompt_decorator_docstring(): @chatprompt(UserMessage("This is a user message.")) async def func(one: int) -> str: """This is the docstring.""" + ... assert isinstance(func, AsyncChatPromptFunction) assert getdoc(func) == "This is the docstring."