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

Feature: Replace halo, click, and termcolor with rich #1091

Merged
merged 8 commits into from
May 22, 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
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ repos:
rev: 22.3.0
hooks:
- id: black
exclude: ^pdm/_vendor

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
Expand Down
1 change: 1 addition & 0 deletions news/1091.dep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop the vendored libraries `click`, `halo`, `colorama` and `log_symbols`. PDM has no vendors now.
1 change: 1 addition & 0 deletions news/1091.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switch the UI backend to `rich`.
1 change: 1 addition & 0 deletions news/1091.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Extract the compatibility import statements into `compat` module.
250 changes: 55 additions & 195 deletions pdm.lock

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions pdm/_types.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import sys
from typing import Any, Dict, List, NamedTuple, Tuple, Union
from __future__ import annotations

if sys.version_info >= (3, 8):
from importlib.metadata import Distribution
from typing import Literal, Protocol, TypedDict
else:
from importlib_metadata import Distribution
from typing_extensions import Literal, Protocol, TypedDict
from typing import Any, Dict, List, NamedTuple, Tuple, TypeVar, Union

from pdm.compat import Literal, Protocol, TypedDict


class Source(TypedDict, total=False):
url: str
verify_ssl: bool
name: str
type: Union[Literal["index"], Literal["find_links"]]
type: Literal["index"] | Literal["find_links"]


RequirementDict = Union[str, Dict[str, Union[bool, str]]]
RequirementDict = Union[str, Dict[str, Union[str, bool]]]
CandidateInfo = Tuple[List[str], str, str]


Expand All @@ -31,15 +27,18 @@ def __lt__(self, __other: Any) -> bool:
...


SearchResult = List[Package]
SpinnerT = TypeVar("SpinnerT", bound="Spinner")


__all__ = (
"Literal",
"Source",
"RequirementDict",
"CandidateInfo",
"Distribution",
"Package",
"SearchResult",
"Protocol",
)
class Spinner(Protocol):
def update(self, text: str) -> None:
...

def __enter__(self: SpinnerT) -> SpinnerT:
...

def __exit__(self, *args: Any) -> None:
...


SearchResult = List[Package]
Empty file removed pdm/_vendor/__init__.py
Empty file.
27 changes: 0 additions & 27 deletions pdm/_vendor/colorama/LICENSE.txt

This file was deleted.

6 changes: 0 additions & 6 deletions pdm/_vendor/colorama/__init__.py

This file was deleted.

102 changes: 0 additions & 102 deletions pdm/_vendor/colorama/ansi.py

This file was deleted.

Loading