Skip to content

Commit

Permalink
Change logging level for Scrubbed PYTHONPATH from env message + use f…
Browse files Browse the repository at this point in the history
…strings (pantsbuild#11480)

### Problem

If PYTHONPATH is defined in the env, this message will show up every time pants start, which is somewhat noisy (and also probably useless)

### Solution

Change log level of that message. Users already expect that Pants is isolating their pythonpath, and (should) know that they need to declare deps.

### Result

Cleaner output in pants runs.
  • Loading branch information
asherf authored Jan 21, 2021
1 parent c630218 commit bebdf6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/python/pants/bin/pants_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _should_run_with_pantsd(self, global_bootstrap_options: OptionValueContainer
terminate_pantsd = self.will_terminate_pantsd()

if terminate_pantsd:
logger.debug("Pantsd terminating goal detected: {}".format(self.args))
logger.debug(f"Pantsd terminating goal detected: {self.args}")

# If we want concurrent pants runs, we can't have pantsd enabled.
return (
Expand All @@ -55,7 +55,7 @@ def scrub_pythonpath() -> None:
# this warning.
pythonpath = os.environ.pop("PYTHONPATH", None)
if pythonpath and not os.environ.pop("RUNNING_PANTS_FROM_SOURCES", None):
logger.warning(f"Scrubbed PYTHONPATH={pythonpath} from the environment.")
logger.debug(f"Scrubbed PYTHONPATH={pythonpath} from the environment.")

def run(self, start_time: float) -> ExitCode:
self.scrub_pythonpath()
Expand All @@ -76,7 +76,7 @@ def run(self, start_time: float) -> ExitCode:
remote_runner = RemotePantsRunner(self.args, self.env, options_bootstrapper)
return remote_runner.run()
except RemotePantsRunner.Fallback as e:
logger.warning("Client exception: {!r}, falling back to non-daemon mode".format(e))
logger.warning(f"Client exception: {e!r}, falling back to non-daemon mode")

# N.B. Inlining this import speeds up the python thin client run by about 100ms.
from pants.bin.local_pants_runner import LocalPantsRunner
Expand Down

0 comments on commit bebdf6d

Please sign in to comment.