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

Trim obscene amount of output for Target reprs. #2651

Merged
merged 1 commit into from
Jan 24, 2025
Merged
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
12 changes: 8 additions & 4 deletions pex/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __bool__(self):
__nonzero__ = __bool__


@attr.s(frozen=True)
@attr.s(frozen=True, repr=False)
class Target(object):
id = attr.ib() # type: str
platform = attr.ib() # type: Platform
Expand Down Expand Up @@ -195,8 +195,12 @@ def __str__(self):
def render_description(self):
raise NotImplementedError()

def __repr__(self):
# type: () -> str
return "{clazz}({self!r})".format(clazz=type(self).__name__, self=str(self))

@attr.s(frozen=True)

@attr.s(frozen=True, repr=False)
class LocalInterpreter(Target):
@classmethod
def create(cls, interpreter=None):
Expand Down Expand Up @@ -248,7 +252,7 @@ def render_description(self):
)


@attr.s(frozen=True)
@attr.s(frozen=True, repr=False)
class AbbreviatedPlatform(Target):
@classmethod
def create(cls, platform):
Expand All @@ -273,7 +277,7 @@ def current():
return LocalInterpreter.create()


@attr.s(frozen=True)
@attr.s(frozen=True, repr=False)
class CompletePlatform(Target):
@classmethod
def from_interpreter(cls, interpreter):
Expand Down