import io import pkginfo from pkginfo.distribution import HEADER_ATTRS from pkginfo.distribution import HEADER_ATTRS_2_0 from poetry.utils._compat import Path from .dependency import Dependency # Patching pkginfo to support Metadata version 2.1 (PEP 566) HEADER_ATTRS.update( { '2.1': HEADER_ATTRS_2_0 + ( ('Provides-Extra', 'provides_extra', True), ) } ) class FileDependency(Dependency): def __init__(self, path, # type: Path category='main', # type: str optional=False, # type: bool base=None # type: Path ): self._path = path self._base = base
from pkginfo.distribution import HEADER_ATTRS from pkginfo.distribution import HEADER_ATTRS_2_0 from poetry.utils._compat import Path from poetry.utils.toml_file import TomlFile from .dependency import Dependency # Patching pkginfo to support Metadata version 2.1 (PEP 566) HEADER_ATTRS.update( {"2.1": HEADER_ATTRS_2_0 + (("Provides-Extra", "provides_extra", True), )}) class DirectoryDependency(Dependency): def __init__( self, name, path, # type: Path category="main", # type: str optional=False, # type: bool base=None, # type: Path develop=True, # type: bool ): self._path = path self._base = base self._full_path = path self._develop = develop self._supports_poetry = False if self._base and not self._path.is_absolute(): self._full_path = self._base / self._path
from pkginfo.distribution import HEADER_ATTRS from pkginfo.distribution import HEADER_ATTRS_2_0 from poetry.io import NullIO from poetry.utils._compat import Path from poetry.utils._compat import decode from poetry.utils.helpers import parse_requires from poetry.utils.toml_file import TomlFile from poetry.utils.venv import NullVenv from poetry.utils.venv import Venv from .dependency import Dependency # Patching pkginfo to support Metadata version 2.1 (PEP 566) HEADER_ATTRS.update( {"2.1": HEADER_ATTRS_2_0 + (("Provides-Extra", "provides_extra", True),)} ) class DirectoryDependency(Dependency): def __init__( self, path, # type: Path category="main", # type: str optional=False, # type: bool base=None, # type: Path develop=False, # type: bool ): from . import dependency_from_pep_508 from .package import Package