Skip to content

Commit

Permalink
Revert "Replace print statement with logger"
Browse files Browse the repository at this point in the history
This reverts commit 853d481.

It's best to leave print statements in the setup script.
See also: mc2-project#179
  • Loading branch information
jochasinga committed Aug 17, 2021
1 parent 853d481 commit 60c2ea4
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions python-package/setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import logging
import multiprocessing
import os
import shutil
import subprocess
import sys

from setuptools import find_packages, setup

# # Configure logging
logger = logging.getLogger()
logger.setLevel("DEBUG")

# Get the absolute path of setup.py
setup_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))

Expand Down Expand Up @@ -104,8 +101,8 @@
# to the root directory of the mc2 repository for easier paths in
# the configuration yamls.

logger.debug("\n{:#^20}\n".format(''))
logger.debug("Configuring shell for MC2 Client...\n")
print("\n####################\n")
print("Configuring shell for MC2 Client...\n")

home_path = os.path.abspath(os.path.join(setup_path, "../"))
# Terminal shell initialization scripts to support
Expand Down Expand Up @@ -146,20 +143,20 @@ def set_path(path):
shell_paths_set = [set_path(path) for path in shell_paths]

if not any(shell_paths_set):
logger.debug("ERROR: Failed to write to any of the following:\n")
print("ERROR: Failed to write to any of the following:\n")
for path in shell_paths:
logger.debug(f"\t{path}")
logger.debug(
print(f"\t{path}")
print(
"\nPlease add the following line to your shell initialization\n"
"file to ensure that MC2 Client is configured automatically:\n\n"
f"\texport MC2_CLIENT_HOME={home_path}"
)
else:
logger.debug("Successfully modified:\n")
print("Successfully modified:\n")
for (success, path) in zip(shell_paths_set, shell_paths):
if success:
logger.debug(f"\t{path}")
logger.debug("\nTo run MC2 Client you may need to restart your current shell.")
print(f"\t{path}")
print("\nTo run MC2 Client you may need to restart your current shell.")

env_path = os.path.join(home_path, "mc2_client_env")
print(f"\nTo configure your current shell, run:\n\n\tsource {env_path}\n")

0 comments on commit 60c2ea4

Please sign in to comment.