Skip to content

Commit

Permalink
Improve name= used for Python requirement target generators with `t…
Browse files Browse the repository at this point in the history
…ailor` (Cherry-pick of #15507) (#15520)

Improve `name=` used for Python requirement target generators with `tailor` (#15507)

We were using the file-name, which was a hold-over from when we had Context-Aware Object Factories and the `name=` was ignored. This was an oversight that we were still doing this.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano authored May 18, 2022
1 parent cb6e87d commit a042388
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/goals/tailor.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def find_putative_targets(
pts.append(
PutativeTarget(
path=path,
name=name,
name="reqs",
type_alias="python_requirements",
triggering_sources=[req_file],
owned_sources=[name],
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/goals/tailor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_find_putative_targets(rule_runner: RuleRunner) -> None:
PutativeTarget.for_target_type(
PythonRequirementsTargetGenerator,
path="3rdparty",
name="requirements-test.txt",
name="reqs",
triggering_sources=["3rdparty/requirements-test.txt"],
kwargs={"source": "requirements-test.txt"},
),
Expand Down

0 comments on commit a042388

Please sign in to comment.