Skip to content

Commit

Permalink
Merge branch 'main' into ww/restrict-egg-fragement
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw authored Dec 28, 2022
2 parents 76cff14 + cecd346 commit 64fe223
Show file tree
Hide file tree
Showing 34 changed files with 377 additions and 112 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ on:
schedule:
- cron: 0 0 * * MON # Run every Monday at 00:00 UTC

env:
# The "FORCE_COLOR" variable, when set to 1,
# tells Nox to colorize itself.
FORCE_COLOR: "1"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
Expand Down
3 changes: 0 additions & 3 deletions news/11547.bugfix.rst

This file was deleted.

1 change: 1 addition & 0 deletions news/11638.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make ``pip show`` show the editable location if package is editable
3 changes: 3 additions & 0 deletions news/11673.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Stop checking that ``wheel`` is present when ``build-system.requires``
is provided without ``build-system.build-backend`` as ``setuptools``
(which we still check for) will inject it anyway.
Empty file.
1 change: 1 addition & 0 deletions news/rich.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade rich to 12.6.0
6 changes: 6 additions & 0 deletions src/pip/_internal/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class _PackageInfo(NamedTuple):
name: str
version: str
location: str
editable_project_location: Optional[str]
requires: List[str]
required_by: List[str]
installer: str
Expand Down Expand Up @@ -120,6 +121,7 @@ def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]:
name=dist.raw_name,
version=str(dist.version),
location=dist.location or "",
editable_project_location=dist.editable_project_location,
requires=requires,
required_by=required_by,
installer=dist.installer,
Expand Down Expand Up @@ -158,6 +160,10 @@ def print_results(
write_output("Author-email: %s", dist.author_email)
write_output("License: %s", dist.license)
write_output("Location: %s", dist.location)
if dist.editable_project_location is not None:
write_output(
"Editable project location: %s", dist.editable_project_location
)
write_output("Requires: %s", ", ".join(dist.requires))
write_output("Required-by: %s", ", ".join(dist.required_by))

Expand Down
7 changes: 3 additions & 4 deletions src/pip/_internal/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ def load_pyproject_toml(
if backend is None:
# If the user didn't specify a backend, we assume they want to use
# the setuptools backend. But we can't be sure they have included
# a version of setuptools which supplies the backend, or wheel
# (which is needed by the backend) in their requirements. So we
# make a note to check that those requirements are present once
# a version of setuptools which supplies the backend. So we
# make a note to check that this requirement is present once
# we have set up the environment.
# This is quite a lot of work to check for a very specific case. But
# the problem is, that case is potentially quite common - projects that
Expand All @@ -170,6 +169,6 @@ def load_pyproject_toml(
# tools themselves. The original PEP 518 code had a similar check (but
# implemented in a different way).
backend = "setuptools.build_meta:__legacy__"
check = ["setuptools>=40.8.0", "wheel"]
check = ["setuptools>=40.8.0"]

return BuildSystemDetails(requires, backend, check, backend_path)
7 changes: 4 additions & 3 deletions src/pip/_vendor/rich/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ._extension import load_ipython_extension # noqa: F401

__all__ = ["get_console", "reconfigure", "print", "inspect"]
__all__ = ["get_console", "reconfigure", "print", "inspect", "print_json"]

if TYPE_CHECKING:
from .console import Console
Expand Down Expand Up @@ -40,7 +40,8 @@ def reconfigure(*args: Any, **kwargs: Any) -> None:
"""Reconfigures the global console by replacing it with another.
Args:
console (Console): Replacement console instance.
*args (Any): Positional arguments for the replacement :class:`~rich.console.Console`.
**kwargs (Any): Keyword arguments for the replacement :class:`~rich.console.Console`.
"""
from pip._vendor.rich.console import Console

Expand Down Expand Up @@ -80,7 +81,7 @@ def print_json(
indent: Union[None, int, str] = 2,
highlight: bool = True,
skip_keys: bool = False,
ensure_ascii: bool = True,
ensure_ascii: bool = False,
check_circular: bool = True,
allow_nan: bool = True,
default: Optional[Callable[[Any], Any]] = None,
Expand Down
8 changes: 0 additions & 8 deletions src/pip/_vendor/rich/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,6 @@ def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:

c = Console(record=True)
c.print(test_card)
# c.save_svg(
# path="/Users/darrenburns/Library/Application Support/JetBrains/PyCharm2021.3/scratches/svg_export.svg",
# title="Rich can export to SVG",
# )

print(f"rendered in {pre_cache_taken}ms (cold cache)")
print(f"rendered in {taken}ms (warm cache)")
Expand All @@ -247,10 +243,6 @@ def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
"Textualize",
"[u blue link=https://github.com/textualize]https://github.com/textualize",
)
sponsor_message.add_row(
"Buy devs a :coffee:",
"[u blue link=https://ko-fi.com/textualize]https://ko-fi.com/textualize",
)
sponsor_message.add_row(
"Twitter",
"[u blue link=https://twitter.com/willmcgugan]https://twitter.com/willmcgugan",
Expand Down
83 changes: 83 additions & 0 deletions src/pip/_vendor/rich/_null_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from types import TracebackType
from typing import IO, Iterable, Iterator, List, Optional, Type


class NullFile(IO[str]):

# TODO: "mode", "name" and "closed" are only required for Python 3.6.

@property
def mode(self) -> str:
return ""

@property
def name(self) -> str:
return "NullFile"

def closed(self) -> bool:
return False

def close(self) -> None:
pass

def isatty(self) -> bool:
return False

def read(self, __n: int = 1) -> str:
return ""

def readable(self) -> bool:
return False

def readline(self, __limit: int = 1) -> str:
return ""

def readlines(self, __hint: int = 1) -> List[str]:
return []

def seek(self, __offset: int, __whence: int = 1) -> int:
return 0

def seekable(self) -> bool:
return False

def tell(self) -> int:
return 0

def truncate(self, __size: Optional[int] = 1) -> int:
return 0

def writable(self) -> bool:
return False

def writelines(self, __lines: Iterable[str]) -> None:
pass

def __next__(self) -> str:
return ""

def __iter__(self) -> Iterator[str]:
return iter([""])

def __enter__(self) -> IO[str]:
pass

def __exit__(
self,
__t: Optional[Type[BaseException]],
__value: Optional[BaseException],
__traceback: Optional[TracebackType],
) -> None:
pass

def write(self, text: str) -> int:
return 0

def flush(self) -> None:
pass

def fileno(self) -> int:
return -1


NULL_FILE = NullFile()
2 changes: 1 addition & 1 deletion src/pip/_vendor/rich/ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self) -> None:
self.style = Style.null()

def decode(self, terminal_text: str) -> Iterable[Text]:
"""Decode ANSI codes in an interable of lines.
"""Decode ANSI codes in an iterable of lines.
Args:
lines (Iterable[str]): An iterable of lines of terminal output.
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_vendor/rich/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,4 +514,4 @@ def get_bottom(self, widths: Iterable[int]) -> str:
columns.add_renderable(table)
console.print(columns)

# console.save_html("box.html", inline_styles=True)
# console.save_svg("box.svg")
5 changes: 4 additions & 1 deletion src/pip/_vendor/rich/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class ColorSystem(IntEnum):
def __repr__(self) -> str:
return f"ColorSystem.{self.name}"

def __str__(self) -> str:
return repr(self)


class ColorType(IntEnum):
"""Type of color stored in Color class."""
Expand Down Expand Up @@ -310,7 +313,7 @@ class Color(NamedTuple):
"""A triplet of color components, if an RGB color."""

def __rich__(self) -> "Text":
"""Dispays the actual color if Rich printed."""
"""Displays the actual color if Rich printed."""
from .style import Style
from .text import Text

Expand Down
Loading

0 comments on commit 64fe223

Please sign in to comment.