From 7cdc107051f47b774983fd4c7ed95b36db17fd18 Mon Sep 17 00:00:00 2001 From: Lucy Wang Date: Mon, 9 Aug 2021 14:40:04 +0800 Subject: [PATCH] fix ci --- tox.ini | 2 ++ w3lib/util.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e2d212cf..4e8e4767 100644 --- a/tox.ini +++ b/tox.ini @@ -25,6 +25,8 @@ commands = [testenv:typing] basepython = python3 deps = + # mypy would error if pytest (or its sub) not found + pytest mypy==0.910 commands = mypy --show-error-codes {posargs: w3lib tests} diff --git a/w3lib/util.py b/w3lib/util.py index 58ca867f..c9eba65f 100644 --- a/w3lib/util.py +++ b/w3lib/util.py @@ -6,6 +6,12 @@ def str_to_unicode( text: StrOrBytes, encoding: Optional[str] = None, errors: str = "strict" ) -> str: + warn( + "The w3lib.utils.str_to_unicode function is deprecated and " + "will be removed in a future release.", + DeprecationWarning, + stacklevel=2, + ) if encoding is None: encoding = "utf-8" if isinstance(text, bytes): @@ -64,7 +70,7 @@ def to_bytes( def to_native_str( text: StrOrBytes, encoding: Optional[str] = None, errors: str = "strict" ) -> str: - """ Return str representation of `text` """ + """Return str representation of `text`""" warn( "The w3lib.utils.to_native_str function is deprecated and " "will be removed in a future release. Please use "