rapid-bird-79300
06/18/2021, 2:24 PMisort
when running ./pants fmt --changed-since=origin/master
. The BUILD file in the changed targets has skip_isort=True
and it seems pants is executing isort
with 0 files which causes an error.
07:22:13.36 [DEBUG] Completed: Run isort on 0 files.
07:22:13.36 [DEBUG] Completed: (Waiting) Run isort on 0 files.
07:22:13.36 [DEBUG] Completed: Format with isort
07:22:13.36 [DEBUG] Completed: `fmt` goal
07:22:13.36 [DEBUG] computed 1 nodes in 2.802568 seconds. there are 448 total nodes.
07:22:13.36 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 234, in _run_inner
return self._perform_run(goals)
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 173, in _perform_run
return self._perform_run_body(goals, poll=False)
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 195, in _perform_run_body
poll_delay=(0.1 if poll else None),
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/init/engine_initializer.py", line 136, in run_goal_rules
goal_product, params, poll=poll, poll_delay=poll_delay
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 530, in run_goal_rule
self._raise_on_error([t for _, t in throws])
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 494, in _raise_on_error
wrapped_exceptions=tuple(t.exc for t in throws),
Exception message: 1 Exception encountered:
Engine traceback:
in select
in pants.core.goals.fmt.fmt
in pants.backend.python.lint.python_fmt.format_python_target
in pants.core.goals.fmt.enrich_fmt_result
in pants.backend.python.lint.isort.rules.isort_fmt
in pants.engine.process.fallible_to_exec_result_or_raise
Traceback (most recent call last):
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/engine/process.py", line 254, in fallible_to_exec_result_or_raise
description.value,
pants.engine.process.ProcessExecutionFailure: Process 'Run isort on 0 files.' failed with exit code 1.
stdout:
_ _
(_) ___ ___ _ __| |_
| |/ _/ / _ \/ '__ _/
| |\__ \/\_\/| | | |_
|_|\___/\___/\_/ \_/
isort your imports, so you don't have to.
VERSION 5.5.5
Nothing to do: no files or paths have have been passed in!
Try one of the following:
`isort .` - sort all Python files, starting from the current directory, recursively.
`isort . --interactive` - Do the same, but ask before making any changes.
`isort . --check --diff` - Check to see if imports are correctly sorted within this project.
`isort --help` - In-depth information about isort's available command-line options.
Visit <https://pycqa.github.io/isort/> for complete information about how to use isort.
stderr:
Error: arguments passed in without any paths or content.
Has anyone seen this before?07:39:59.88 [DEBUG] Completed: Run Black on 0 files.
07:39:59.88 [DEBUG] Completed: (Waiting) Run Black on 0 files.
07:39:59.88 [DEBUG] Completed: Format with Black
07:39:59.88 [INFO] Completed: fmt - Black made no changes.
No Path provided. Nothing to do š“
ā Black made no changes.
- isort skipped.
07:39:59.88 [DEBUG] Completed: `fmt` goal
07:39:59.88 [DEBUG] computed 1 nodes in 9.962709 seconds. there are 489 total nodes.
hundreds-father-404
06/18/2021, 2:41 PMrapid-bird-79300
06/18/2021, 2:49 PM./pants fmt --changed-since=origin/main
you should see the error--changed-since
subsystemhundreds-father-404
06/18/2021, 6:50 PMgit diff --stat origin/master
? I'm not reproducingrapid-bird-79300
06/18/2021, 7:21 PMnjgrisafi@Nicholass-MBP ~/workspace/pants-example (break-isort)$ git diff --stat origin/main
app/BUILD | 4 +++-
app/module_1/BUILD | 4 +++-
app/module_1/tests/BUILD | 5 ++++-
pants.toml | 9 +++++----
pyproject.toml | 8 ++++++++
5 files changed, 23 insertions(+), 7 deletions(-)
njgrisafi@Nicholass-MBP ~/workspace/pants-example (break-isort)$ ./pants fmt --changed-since=origin/main
12:21:04.42 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 234, in _run_inner
return self._perform_run(goals)
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 173, in _perform_run
return self._perform_run_body(goals, poll=False)
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 195, in _perform_run_body
poll_delay=(0.1 if poll else None),
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/init/engine_initializer.py", line 136, in run_goal_rules
goal_product, params, poll=poll, poll_delay=poll_delay
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 530, in run_goal_rule
self._raise_on_error([t for _, t in throws])
File "/Users/njgrisafi/.cache/pants/setup/bootstrap-Darwin-x86_64/2.5.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 500, in _raise_on_error
wrapped_exceptions=tuple(t.exc for t in throws),
Exception message: 1 Exception encountered:
ProcessExecutionFailure: Process 'Run isort on 0 files.' failed with exit code 1.
stdout:
_ _
(_) ___ ___ _ __| |_
| |/ _/ / _ \/ '__ _/
| |\__ \/\_\/| | | |_
|_|\___/\___/\_/ \_/
isort your imports, so you don't have to.
VERSION 5.5.5
Nothing to do: no files or paths have have been passed in!
Try one of the following:
`isort .` - sort all Python files, starting from the current directory, recursively.
`isort . --interactive` - Do the same, but ask before making any changes.
`isort . --check --diff` - Check to see if imports are correctly sorted within this project.
`isort --help` - In-depth information about isort's available command-line options.
Visit <https://pycqa.github.io/isort/> for complete information about how to use isort.
stderr:
Error: arguments passed in without any paths or content.
(Use --print-stacktrace to see more error details.)
hundreds-father-404
06/18/2021, 7:22 PMrapid-bird-79300
06/18/2021, 7:22 PMorigin/master
-> origin/main
for that repo if you are testing therehundreds-father-404
06/19/2021, 12:05 AM./pants
script is out of date: https://raw.githubusercontent.com/pantsbuild/setup/gh-pages/pants
And you can remove [isort].config
if using Pants 2.5. It should be auto-discoveredfmt
, not lint
rapid-bird-79300
06/19/2021, 12:09 AMfmt
with --changed-since
we use this script in CI and for local environment fixeshundreds-father-404
06/19/2021, 12:19 AM