Skip to content

Commit

Permalink
perf: Remove shutil from the import tree
Browse files Browse the repository at this point in the history
  • Loading branch information
adityahase committed Feb 21, 2021
1 parent 6706b23 commit 07ecaa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import logging
import os
import re
import shutil
import subprocess
import sys

Expand Down Expand Up @@ -89,6 +88,7 @@ def remove_from_excluded_apps_txt(app, bench_path='.'):

def get_app(git_url, branch=None, bench_path='.', skip_assets=False, verbose=False, restart_bench=True, overwrite=False):
import requests
import shutil

if not os.path.exists(git_url):
if not is_git_url(git_url):
Expand Down Expand Up @@ -195,6 +195,7 @@ def install_app(app, bench_path=".", verbose=False, no_cache=False, restart_benc


def remove_app(app, bench_path='.'):
import shutil
from bench.config.common_site_config import get_config

if app not in get_apps(bench_path):
Expand Down
6 changes: 5 additions & 1 deletion bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import pwd
import re
import select
import shutil
import site
import subprocess
import sys
Expand Down Expand Up @@ -261,6 +260,8 @@ def update(pull=False, apps=None, patch=False, build=False, requirements=False,


def copy_patches_txt(bench_path):
import shutil

shutil.copy(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'patches', 'patches.txt'),
os.path.join(bench_path, 'patches.txt'))

Expand Down Expand Up @@ -900,6 +901,8 @@ def get_bench_name(bench_path):


def setup_fonts():
import shutil

fonts_path = os.path.join('/tmp', 'fonts')

if os.path.exists('/etc/fonts_backup'):
Expand Down Expand Up @@ -972,6 +975,7 @@ def find_benches(directory=None):


def migrate_env(python, backup=False):
import shutil
from six.moves.urllib.parse import urlparse
from bench.config.common_site_config import get_config
from bench.app import get_apps
Expand Down

0 comments on commit 07ecaa1

Please sign in to comment.