Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code #419

Merged
merged 3 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/poetry/core/utils/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,3 @@


WINDOWS = sys.platform == "win32"


def list_to_shell_command(cmd: list[str]) -> str:
executable = cmd[0]

if " " in executable:
executable = f'"{executable}"'
cmd[0] = executable

return " ".join(cmd)
13 changes: 1 addition & 12 deletions src/poetry/core/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
import tempfile
import unicodedata

from collections.abc import Mapping
from contextlib import contextmanager
from pathlib import Path
from typing import Any
from typing import Iterator
from typing import no_type_check

from poetry.core.version.pep440 import PEP440Version

Expand Down Expand Up @@ -43,7 +41,6 @@ def temporary_directory(*args: Any, **kwargs: Any) -> Iterator[str]:
safe_rmtree(name)


@no_type_check
def parse_requires(requires: str) -> list[str]:
lines = requires.split("\n")

Expand All @@ -62,7 +59,7 @@ def parse_requires(requires: str) -> list[str]:
# extras or conditional dependencies
marker = line.lstrip("[").rstrip("]")
if ":" not in marker:
extra, marker = marker, None
extra, marker = marker, ""
else:
extra, marker = marker.split(":")

Expand Down Expand Up @@ -100,14 +97,6 @@ def safe_rmtree(path: str | Path) -> None:
shutil.rmtree(path, onerror=_on_rm_error)


def merge_dicts(d1: dict[Any, Any], d2: dict[Any, Any]) -> None:
for k in d2.keys():
if k in d1 and isinstance(d1[k], dict) and isinstance(d2[k], Mapping):
merge_dicts(d1[k], d2[k])
else:
d1[k] = d2[k]


def readme_content_type(path: str | Path) -> str:
suffix = Path(path).suffix
if suffix == ".rst":
Expand Down