From 33073cb2c403a1f0398069d1c83819f465070456 Mon Sep 17 00:00:00 2001 From: Thomas Kemmer Date: Fri, 17 Dec 2021 06:21:35 +0100 Subject: [PATCH] Remove deprecated submodules. --- src/cachetools/cache.py | 9 ------ src/cachetools/fifo.py | 9 ------ src/cachetools/lfu.py | 9 ------ src/cachetools/lru.py | 9 ------ src/cachetools/mru.py | 9 ------ src/cachetools/rr.py | 9 ------ src/cachetools/ttl.py | 9 ------ tests/test_deprecated.py | 67 ---------------------------------------- 8 files changed, 130 deletions(-) delete mode 100644 src/cachetools/cache.py delete mode 100644 src/cachetools/fifo.py delete mode 100644 src/cachetools/lfu.py delete mode 100644 src/cachetools/lru.py delete mode 100644 src/cachetools/mru.py delete mode 100644 src/cachetools/rr.py delete mode 100644 src/cachetools/ttl.py delete mode 100644 tests/test_deprecated.py diff --git a/src/cachetools/cache.py b/src/cachetools/cache.py deleted file mode 100644 index ee5269d..0000000 --- a/src/cachetools/cache.py +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from . import Cache - -warnings.warn( - "cachetools.cache is deprecated, please use cachetools.Cache", - DeprecationWarning, - stacklevel=2, -) diff --git a/src/cachetools/fifo.py b/src/cachetools/fifo.py deleted file mode 100644 index a29b789..0000000 --- a/src/cachetools/fifo.py +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from . import FIFOCache - -warnings.warn( - "cachetools.fifo is deprecated, please use cachetools.FIFOCache", - DeprecationWarning, - stacklevel=2, -) diff --git a/src/cachetools/lfu.py b/src/cachetools/lfu.py deleted file mode 100644 index 5c9acef..0000000 --- a/src/cachetools/lfu.py +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from . import LFUCache - -warnings.warn( - "cachetools.lfu is deprecated, please use cachetools.LFUCache", - DeprecationWarning, - stacklevel=2, -) diff --git a/src/cachetools/lru.py b/src/cachetools/lru.py deleted file mode 100644 index 48ddb36..0000000 --- a/src/cachetools/lru.py +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from . import LRUCache - -warnings.warn( - "cachetools.lru is deprecated, please use cachetools.LRUCache", - DeprecationWarning, - stacklevel=2, -) diff --git a/src/cachetools/mru.py b/src/cachetools/mru.py deleted file mode 100644 index a486dc4..0000000 --- a/src/cachetools/mru.py +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from . import MRUCache - -warnings.warn( - "cachetools.mru is deprecated, please use cachetools.MRUCache", - DeprecationWarning, - stacklevel=2, -) diff --git a/src/cachetools/rr.py b/src/cachetools/rr.py deleted file mode 100644 index 81331bc..0000000 --- a/src/cachetools/rr.py +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from . import RRCache - -warnings.warn( - "cachetools.rr is deprecated, please use cachetools.RRCache", - DeprecationWarning, - stacklevel=2, -) diff --git a/src/cachetools/ttl.py b/src/cachetools/ttl.py deleted file mode 100644 index ef343da..0000000 --- a/src/cachetools/ttl.py +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from . import TTLCache - -warnings.warn( - "cachetools.ttl is deprecated, please use cachetools.TTLCache", - DeprecationWarning, - stacklevel=2, -) diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py deleted file mode 100644 index 6510c82..0000000 --- a/tests/test_deprecated.py +++ /dev/null @@ -1,67 +0,0 @@ -import unittest -import warnings - - -class DeprecatedTest(unittest.TestCase): - def test_cache(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - from cachetools.cache import Cache - - assert len(w) == 1 - assert issubclass(w[-1].category, DeprecationWarning) - assert "cachetools.cache" in str(w[-1].message) - - def test_fifo(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - from cachetools.fifo import FIFOCache - - assert len(w) == 1 - assert issubclass(w[-1].category, DeprecationWarning) - assert "cachetools.fifo" in str(w[-1].message) - - def test_lfu(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - from cachetools.lfu import LFUCache - - assert len(w) == 1 - assert issubclass(w[-1].category, DeprecationWarning) - assert "cachetools.lfu" in str(w[-1].message) - - def test_lru(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - from cachetools.lru import LRUCache - - assert len(w) == 1 - assert issubclass(w[-1].category, DeprecationWarning) - assert "cachetools.lru" in str(w[-1].message) - - def test_mru(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - from cachetools.mru import MRUCache - - assert len(w) == 1 - assert issubclass(w[-1].category, DeprecationWarning) - assert "cachetools.mru" in str(w[-1].message) - - def test_rr(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - from cachetools.rr import RRCache - - assert len(w) == 1 - assert issubclass(w[-1].category, DeprecationWarning) - assert "cachetools.rr" in str(w[-1].message) - - def test_ttl(self): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("always") - from cachetools.ttl import TTLCache - - assert len(w) == 1 - assert issubclass(w[-1].category, DeprecationWarning) - assert "cachetools.ttl" in str(w[-1].message)