Remove our @deprecated decorator and use standard package

This commit is contained in:
James R. Barlow
2022-08-04 04:00:25 -07:00
parent 670ce2b969
commit 1a0a797ca6
3 changed files with 1 additions and 27 deletions
+1
View File
@@ -46,6 +46,7 @@ packages = find:
install_requires =
Pillow>=8.2.0
coloredlogs>=14.0 # strictly optional
deprecation>=2.1.0
img2pdf>=0.3.0 # pure Python
packaging>=20
pdfminer.six!=20200720,>=20191110
-18
View File
@@ -13,7 +13,6 @@ import warnings
from collections import namedtuple
from collections.abc import Iterable
from contextlib import suppress
from functools import wraps
from io import StringIO
from math import isclose, isfinite
from pathlib import Path
@@ -275,20 +274,3 @@ def pikepdf_enable_mmap():
# Fix is not in pybind11 2.6.0
# log.debug("pikepdf mmap disabled")
return
def deprecated(func):
"""Warn that function is deprecated."""
@wraps(func)
def new_func(*args, **kwargs):
warnings.simplefilter('always', DeprecationWarning) # turn off filter
warnings.warn(
f"Call to deprecated function {func.__name__}.",
category=DeprecationWarning,
stacklevel=2,
)
warnings.simplefilter('default', DeprecationWarning) # reset filter
return func(*args, **kwargs)
return new_func
-9
View File
@@ -54,15 +54,6 @@ def test_no_cpu_count(monkeypatch):
assert invoked, "Patched function called during test"
def test_deprecated():
@helpers.deprecated
def old_function():
return 42
with pytest.deprecated_call():
assert old_function() == 42
skipif_docker = pytest.mark.skipif(running_in_docker(), reason="fails on Docker")