__init__.py (poetry-1.1.15) | : | __init__.py (poetry-1.2.0) | ||
---|---|---|---|---|
from typing import Type | from __future__ import annotations | |||
from .layout import Layout | from poetry.layouts.layout import Layout | |||
from .src import SrcLayout | from poetry.layouts.src import SrcLayout | |||
from .standard import StandardLayout | ||||
_LAYOUTS = {"src": SrcLayout, "standard": StandardLayout} | _LAYOUTS = {"src": SrcLayout, "standard": Layout} | |||
def layout(name): # type: (str) -> Type[Layout] | def layout(name: str) -> type[Layout]: | |||
if name not in _LAYOUTS: | if name not in _LAYOUTS: | |||
raise ValueError("Invalid layout") | raise ValueError("Invalid layout") | |||
return _LAYOUTS[name] | return _LAYOUTS[name] | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added |