chore(utils): mark ExistingDirectory and ExistingFile as deprecated

This commit is contained in:
jakob.scheid committed 2026-09-05 14:24:19 +02:00
1 parent 1789352287
commit 5d8dbd659d
2 files changed
+14

No files matched your search

+7
View File
@@ -1,5 +1,12 @@
# Changelog # Changelog
## [Unreleased]
### Deprecated
- utility class for existing directories
- utility class for existing files
## [0.1.0] - 2026-09-01 ## [0.1.0] - 2026-09-01
### Added ### Added
+7
View File
@@ -22,6 +22,12 @@ import errno
from typing import Union from typing import Union
import types import types
try:
from warnings import deprecated
except ImportError:
from typing_extensions import deprecated
@deprecated('Use pathlib.Path instead.')
class ExistingDirectory(pathlib.Path): class ExistingDirectory(pathlib.Path):
''' '''
pathlib.Path subclass that is a directory. pathlib.Path subclass that is a directory.
@@ -37,6 +43,7 @@ class ExistingDirectory(pathlib.Path):
raise NotADirectoryError(errno.ENOTDIR, 'not a directory', path) raise NotADirectoryError(errno.ENOTDIR, 'not a directory', path)
super().__init__(*(path, *args), **kwargs) super().__init__(*(path, *args), **kwargs)
@deprecated('Use pathlib.Path instead.')
class ExistingFile(pathlib.Path): class ExistingFile(pathlib.Path):
''' '''
pathlib.Path subclass that is a file. pathlib.Path subclass that is a file.