Skip to content

Commit

Permalink
WIP: make local_dists internal only
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw committed Apr 2, 2024
1 parent c13d60a commit 8766e93
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/python/pants/backend/python/goals/pytest_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ async def setup_pytest_for_target(
LocalDistsPex,
LocalDistsPexRequest(
addresses,
internal_only=True,
interpreter_constraints=interpreter_constraints,
sources=prepared_sources,
),
Expand Down
2 changes: 0 additions & 2 deletions src/python/pants/backend/python/goals/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ async def create_python_repl_request(
LocalDistsPex,
LocalDistsPexRequest(
request.addresses,
internal_only=True,
interpreter_constraints=interpreter_constraints,
),
)
Expand Down Expand Up @@ -156,7 +155,6 @@ async def create_ipython_repl_request(
LocalDistsPex,
LocalDistsPexRequest(
request.addresses,
internal_only=True,
interpreter_constraints=interpreter_constraints,
sources=sources,
),
Expand Down
7 changes: 3 additions & 4 deletions src/python/pants/backend/python/util_rules/local_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class LocalDistsPexRequest:
"""Request to build the local dists from the dependency closure of a set of addresses."""

addresses: Addresses
internal_only: bool
interpreter_constraints: InterpreterConstraints
# The result will return these with the sources provided by the dists subtracted out.
# This will help the caller prevent sources from appearing twice on sys.path.
Expand All @@ -116,12 +115,10 @@ def __init__(
self,
addresses: Iterable[Address],
*,
internal_only: bool,
interpreter_constraints: InterpreterConstraints,
sources: PythonSourceFiles = PythonSourceFiles.empty(),
) -> None:
object.__setattr__(self, "addresses", Addresses(addresses))
object.__setattr__(self, "internal_only", internal_only)
object.__setattr__(self, "interpreter_constraints", interpreter_constraints)
object.__setattr__(self, "sources", sources)

Expand Down Expand Up @@ -185,7 +182,9 @@ async def build_local_dists(
requirements=PexRequirements(wheels),
interpreter_constraints=request.interpreter_constraints,
additional_inputs=wheels_digest,
internal_only=request.internal_only,
# a "local dists" PEX is always just for consumption by some downstream Pants process,
# i.e. internal
internal_only=True,
additional_args=["--intransitive"],
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def test_build_local_dists(rule_runner: PythonRuleRunner) -> None:
)
request = LocalDistsPexRequest(
addresses,
internal_only=True,
sources=sources,
interpreter_constraints=interpreter_constraints,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ async def create_pex_from_targets(
LocalDistsPex,
LocalDistsPexRequest(
request.addresses,
internal_only=request.internal_only,
interpreter_constraints=interpreter_constraints,
sources=sources,
),
Expand Down

0 comments on commit 8766e93

Please sign in to comment.