-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: deprecate poetry.repositories.pool
- Loading branch information
1 parent
be8e09c
commit 6096ac5
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from __future__ import annotations | ||
|
||
from poetry.repositories.pool import Pool | ||
from poetry.repositories.repository import Repository | ||
from poetry.repositories.repository_pool import RepositoryPool | ||
|
||
|
||
__all__ = ["Repository", "RepositoryPool"] | ||
__all__ = ["Pool", "Repository", "RepositoryPool"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from __future__ import annotations | ||
|
||
import warnings | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from poetry.repositories.repository_pool import RepositoryPool | ||
|
||
|
||
if TYPE_CHECKING: | ||
from poetry.repositories.repository import Repository | ||
|
||
|
||
class Pool(RepositoryPool): | ||
def __init__( | ||
self, | ||
repositories: list[Repository] | None = None, | ||
ignore_repository_names: bool = False, | ||
) -> None: | ||
warnings.warn( | ||
"Object Pool from poetry.repositories.pool is renamed and scheduled for" | ||
" removal in poetry release 1.4.0. Please migrate to RepositoryPool from" | ||
" poetry.repositories.repository_pool.", | ||
DeprecationWarning, | ||
stacklevel=2, | ||
) | ||
super().__init__(repositories, ignore_repository_names) |