Refactor(utils): mark ExistingDirectory and ExistingFile as deprecated #14

Merged
jakob.scheid merged 4 commits from refactor/remove-existing-file-class into main 2026-09-05 14:44:21 +02:00
2 changed files with 14 additions and 0 deletions
Showing only changes of commit 5d8dbd659d - Show all commits

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.