Skip to content

Commit

Permalink
perf: Remove semantic_version 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 07ecaa1 commit 2df0bf7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

# imports - third party imports
import click
import semantic_version
from six.moves import reload_module

# imports - module imports
Expand Down Expand Up @@ -432,6 +431,8 @@ def get_version_from_string(contents, field='__version__'):
return match.group(2)

def get_major_version(version):
import semantic_version

return semantic_version.Version(version).major

def install_apps_from_path(path, bench_path='.'):
Expand Down
5 changes: 2 additions & 3 deletions bench/config/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import re
import subprocess

# imports - third party imports
import semantic_version

# imports - module imports
import bench
from bench.config.common_site_config import get_config
Expand Down Expand Up @@ -62,6 +59,8 @@ def write_redis_config(template_name, context, bench_path):
f.write(template.render(**context))

def get_redis_version():
import semantic_version

version_string = subprocess.check_output('redis-server --version', shell=True)
version_string = version_string.decode('utf-8').strip()
# extract version number from string
Expand Down
2 changes: 1 addition & 1 deletion bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

# imports - third party imports
import click
from semantic_version import Version
from six import iteritems

# imports - module imports
Expand Down Expand Up @@ -89,6 +88,7 @@ def safe_decode(string, encoding = 'utf-8'):

def check_latest_version():
import requests
from semantic_version import Version

try:
pypi_request = requests.get("https://pypi.org/pypi/frappe-bench/json")
Expand Down

0 comments on commit 2df0bf7

Please sign in to comment.