Fix typo and move local imports outside
from setuptools import setup, find_packages
+from pathlib import PosixPath
import tensorhive
+import shutil
def copy_configuration_files():
- import shutil
- from pathlib import PosixPath
target_dir = PosixPath.home() / '.config/TensorHive'
- # destination is given explicitely, just in case we'd want to rename file during the installation process
+ # destination is given explicitly, just in case we'd want to rename file during the installation process
hosts_config_path = {'src': 'hosts_config.ini', 'dst': str(target_dir / 'hosts_config.ini')}
config_path = {'src': 'main_config.ini', 'dst': str(target_dir / 'main_config.ini')}
@@ -22,9 +22,8 @@ def copy_configuration_files():
target_dir.mkdir(parents=True, exist_ok=True)
safe_copy(hosts_config_path['src'], hosts_config_path['dst'])
safe_copy(config_path['src'], config_path['dst'])
- # FIXME Prints are only visible with `pip install foobar --verbose`
- print('Configuration .ini files copied to {}'.format(target_dir))
except Exception:
+ # FIXME Prints are only visible with `pip install foobar --verbose`
print('Unable to copy configuration files to {}'.format(target_dir))
