commit: 8f4a18d32d489d1c899a8ebf08044c0dd0ae4697
Author: Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Sun Dec 14 16:27:44 2025 +0000
Commit: Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Mon Dec 15 12:42:10 2025 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=8f4a18d3
chore: force osutils.abssymlink to internal, removing it
The only users of this is osutils.abspath which is slated
for removal in 0.12.0, thus block any further usage of this.
Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
NEWS.rst | 4 +---
src/snakeoil/osutils/__init__.py | 9 ++-------
tests/test_osutils.py | 2 +-
3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/NEWS.rst b/NEWS.rst
index 3a441ad..f1125ec 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -50,9 +50,6 @@ API deprecations
- snakeoil.osutils.abspath: Will be removed in 0.12.0
Use ``os.path.abspath``.
-- snakeoil.osutils.abssymlink: Will be removed in 0.12.0
- Use ``os.path.*`` functions instead. Be mindful that this protected against
//, which ``os.path.*`` doesn't, but ``pathlib`` should.
-
- snakeoil.osutils.join: Will be removed in 0.12.0
Use ``os.path.join``.
@@ -106,6 +103,7 @@ API removals
- function snakeoil.modules.load_module
- function snakeoil.obj.popattr
- function snakeoil.osutils.access
+- function snakeoil.osutils.abssymlink
- function snakeoil.osutils.readdir
- function snakeoil.osutils.stat_swallow_enoent
- function snakeoil.osutils.alias
diff --git a/src/snakeoil/osutils/__init__.py b/src/snakeoil/osutils/__init__.py
index e3fa3e8..cd7cec4 100644
--- a/src/snakeoil/osutils/__init__.py
+++ b/src/snakeoil/osutils/__init__.py
@@ -4,7 +4,6 @@ OS related functionality
__all__ = (
"abspath",
- "abssymlink",
"ensure_dirs",
"join",
"pjoin",
@@ -178,11 +177,7 @@ def ensure_dirs(path, gid=-1, uid=-1, mode=0o777,
minimal=True):
return True
-@deprecated(
- "Use os.path.* functions instead. Be mindful that this protected against
//, which os.path.* doesn't, but pathlib should",
- removal_in=(0, 12, 0),
-)
-def abssymlink(path):
+def _abssymlink(path):
"""Return the absolute path of a symlink
:param path: filepath to resolve
@@ -227,7 +222,7 @@ def abspath(path):
"""
path = os.path.abspath(path)
try:
- return abssymlink(path)
+ return _abssymlink(path)
except EnvironmentError as e:
if e.errno not in (errno.ENOENT, errno.EINVAL):
raise
diff --git a/tests/test_osutils.py b/tests/test_osutils.py
index a9680bf..cc3ba9d 100644
--- a/tests/test_osutils.py
+++ b/tests/test_osutils.py
@@ -186,7 +186,7 @@ class TestAbsSymlink:
linkname = tmp_path / "link"
target.mkdir()
linkname.symlink_to("target")
- assert osutils.abssymlink(linkname) == str(target)
+ assert osutils._abssymlink(linkname) == str(target)
@deprecated.suppress_deprecations()