commit: db897ed9f5b74649c124b956ff3684e4d1cee634
Author: Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Sat Dec 13 20:57:29 2025 +0000
Commit: Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Mon Dec 15 12:42:09 2025 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=db897ed9
chore: move deprecation into it's own directory. This is prep for adding a tool
Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
src/snakeoil/{deprecation.py => deprecation/__init__.py} | 0
tests/test_contexts.py | 4 ++--
tests/test_demandload.py | 5 +++--
tests/test_deprecation.py | 2 --
tests/test_osutils.py | 6 +++---
tests/test_sequences.py | 4 ++--
6 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/snakeoil/deprecation.py b/src/snakeoil/deprecation/__init__.py
similarity index 100%
rename from src/snakeoil/deprecation.py
rename to src/snakeoil/deprecation/__init__.py
diff --git a/tests/test_contexts.py b/tests/test_contexts.py
index 2c539d1..aa01edd 100644
--- a/tests/test_contexts.py
+++ b/tests/test_contexts.py
@@ -8,11 +8,11 @@ from contextlib import chdir
import pytest
+from snakeoil._internals import deprecated
from snakeoil.contexts import Namespace, SplitExec, syspath
-from snakeoil.deprecation import suppress_deprecations
-@suppress_deprecations()
[email protected]_deprecations()
def test_chdir(tmpdir):
orig_cwd = os.getcwd()
diff --git a/tests/test_demandload.py b/tests/test_demandload.py
index ffcd671..403375d 100644
--- a/tests/test_demandload.py
+++ b/tests/test_demandload.py
@@ -2,12 +2,13 @@ import re
import pytest
-from snakeoil import demandload, deprecation
+from snakeoil import demandload
+from snakeoil._internals import deprecated
class TestDemandCompileRegexp:
def test_demand_compile_regexp(self):
- with deprecation.suppress_deprecations():
+ with deprecated.suppress_deprecations():
scope = {}
demandload.demand_compile_regexp("foo", "frob", scope=scope)
assert list(scope.keys()) == ["foo"]
diff --git a/tests/test_deprecation.py b/tests/test_deprecation.py
index c1b1fd9..b9a3e0e 100644
--- a/tests/test_deprecation.py
+++ b/tests/test_deprecation.py
@@ -2,8 +2,6 @@ import dataclasses
import inspect
import sys
import warnings
-from logging import warning
-from pathlib import Path
from textwrap import dedent
import pytest
diff --git a/tests/test_osutils.py b/tests/test_osutils.py
index a4843ca..a9680bf 100644
--- a/tests/test_osutils.py
+++ b/tests/test_osutils.py
@@ -10,8 +10,8 @@ from unittest import mock
import pytest
from snakeoil import osutils
+from snakeoil._internals import deprecated
from snakeoil.contexts import Namespace
-from snakeoil.deprecation import suppress_deprecations
from snakeoil.osutils import listdir_dirs, listdir_files, sizeof_fmt,
supported_systems
from snakeoil.osutils.mount import MNT_DETACH, MS_BIND, mount, umount
@@ -180,7 +180,7 @@ class TestEnsureDirs:
class TestAbsSymlink:
- @suppress_deprecations()
+ @deprecated.suppress_deprecations()
def test_abssymlink(self, tmp_path):
target = tmp_path / "target"
linkname = tmp_path / "link"
@@ -189,7 +189,7 @@ class TestAbsSymlink:
assert osutils.abssymlink(linkname) == str(target)
-@suppress_deprecations()
[email protected]_deprecations()
class Test_Native_NormPath:
func = staticmethod(osutils.normpath)
diff --git a/tests/test_sequences.py b/tests/test_sequences.py
index d995535..ccb940a 100644
--- a/tests/test_sequences.py
+++ b/tests/test_sequences.py
@@ -5,7 +5,7 @@ from operator import itemgetter
import pytest
from snakeoil import sequences
-from snakeoil.deprecation import suppress_deprecations
+from snakeoil._internals import deprecated
from snakeoil.sequences import (
iter_stable_unique,
split_elements,
@@ -19,7 +19,7 @@ class UnhashableComplex(complex):
raise TypeError
-@suppress_deprecations()
[email protected]_deprecations()
class TestStableUnique:
def common_check(self, func):
# silly