2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-28 06:49:06 +00:00

perf: Remove semantic_version from the import tree

This commit is contained in:
Aditya Hase 2021-02-21 11:12:40 +05:30
parent 07ecaa1f77
commit 2df0bf726d
No known key found for this signature in database
GPG Key ID: 0A55F0FCA0234972
3 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,6 @@ import sys
# imports - third party imports
import click
import semantic_version
from six.moves import reload_module
# imports - module imports
@ -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='.'):

View File

@ -3,9 +3,6 @@ import os
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
@ -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

View File

@ -21,7 +21,6 @@ from distutils.spawn import find_executable
# imports - third party imports
import click
from semantic_version import Version
from six import iteritems
# imports - module imports
@ -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")