Skip to content

Commit

Permalink
Merge b66dc7b into 0a04bbc
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Oct 28, 2020
2 parents 0a04bbc + b66dc7b commit 04ff71a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/python/pants/backend/python/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from pants.backend.python.macros.python_artifact import PythonArtifact
from pants.backend.python.subsystems.pytest import PyTest
from pants.base.deprecated import warn_or_error
from pants.core.goals.package import OutputPathField
from pants.engine.addresses import Address, Addresses, UnparsedAddressInputs
from pants.engine.fs import PathGlobs, Paths
Expand Down Expand Up @@ -189,6 +190,21 @@ class PexPlatformsField(StringOrStringSequenceField):

alias = "platforms"

@classmethod
def compute_value(
cls, raw_value: Optional[Iterable[str]], *, address: Address
) -> Optional[Tuple[str, ...]]:
if isinstance(raw_value, str) and address.is_base_target:
warn_or_error(
deprecated_entity_description=f"Using a bare string for the `{cls.alias}` field",
removal_version="2.2.0.dev0",
hint=(
f"Using a bare string for the `{cls.alias}` field for {address}. Please "
f"instead use a list of strings, i.e. use `[{raw_value}]`."
),
)
return super().compute_value(raw_value, address=address)


class PexInheritPathField(StringField):
"""Whether to inherit the `sys.path` of the environment that the binary runs in.
Expand Down

0 comments on commit 04ff71a

Please sign in to comment.