mirror of
https://github.com/frappe/bench.git
synced 2025-02-03 11:28:24 +00:00
chore: renamed project to match with PyPI
This commit is contained in:
parent
5b955897c3
commit
e218a7aa09
@ -1,10 +1,11 @@
|
|||||||
from jinja2 import Environment, PackageLoader
|
from jinja2 import Environment, PackageLoader
|
||||||
|
|
||||||
__version__ = "4.1.0"
|
VERSION = "5.0.0"
|
||||||
|
PROJECT_NAME = "frappe-bench"
|
||||||
|
FRAPPE_VERSION = None
|
||||||
|
__version__ = VERSION
|
||||||
env = Environment(loader=PackageLoader('bench.config'))
|
env = Environment(loader=PackageLoader('bench.config'))
|
||||||
|
|
||||||
FRAPPE_VERSION = None
|
|
||||||
|
|
||||||
def set_frappe_version(bench_path='.'):
|
def set_frappe_version(bench_path='.'):
|
||||||
from .app import get_current_frappe_version
|
from .app import get_current_frappe_version
|
||||||
|
@ -406,7 +406,7 @@ def switch_branch(branch, apps=None, bench_path='.', upgrade=False, check_upgrad
|
|||||||
if version_upgrade[0] and upgrade:
|
if version_upgrade[0] and upgrade:
|
||||||
update_requirements()
|
update_requirements()
|
||||||
update_node_packages()
|
update_node_packages()
|
||||||
reload_module(utils)
|
reload_module(bench.utils)
|
||||||
backup_all_sites()
|
backup_all_sites()
|
||||||
patch_sites()
|
patch_sites()
|
||||||
build_assets()
|
build_assets()
|
||||||
|
23
bench/cli.py
23
bench/cli.py
@ -1,15 +1,27 @@
|
|||||||
|
# imports - standard imports
|
||||||
|
import json
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import pwd
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# imports - third party imports
|
||||||
import click
|
import click
|
||||||
import os, sys, logging, json, pwd, subprocess
|
|
||||||
from bench.utils import is_root, PatchError, drop_privileges, get_env_cmd, get_cmd_output, get_frappe, log, is_dist_editable, find_parent_bench
|
# imports - module imports
|
||||||
|
import bench
|
||||||
from bench.app import get_apps
|
from bench.app import get_apps
|
||||||
from bench.config.common_site_config import get_config
|
|
||||||
from bench.commands import bench_command
|
from bench.commands import bench_command
|
||||||
|
from bench.config.common_site_config import get_config
|
||||||
|
from bench.utils import PatchError, drop_privileges, find_parent_bench, get_cmd_output, get_env_cmd, get_frappe, is_dist_editable, is_root, log
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger('bench')
|
logger = logging.getLogger(bench.PROJECT_NAME)
|
||||||
from_command_line = False
|
from_command_line = False
|
||||||
change_uid_msg = "You should not run this command as root"
|
change_uid_msg = "You should not run this command as root"
|
||||||
|
|
||||||
|
|
||||||
def cli():
|
def cli():
|
||||||
global from_command_line
|
global from_command_line
|
||||||
from_command_line = True
|
from_command_line = True
|
||||||
@ -19,7 +31,7 @@ def cli():
|
|||||||
change_dir()
|
change_dir()
|
||||||
change_uid()
|
change_uid()
|
||||||
|
|
||||||
if is_dist_editable("bench"):
|
if is_dist_editable(bench.PROJECT_NAME):
|
||||||
log("bench is installed in editable mode!\n\nThis is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`\n", level=3)
|
log("bench is installed in editable mode!\n\nThis is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`\n", level=3)
|
||||||
|
|
||||||
if len(sys.argv) > 2 and sys.argv[1] == "frappe":
|
if len(sys.argv) > 2 and sys.argv[1] == "frappe":
|
||||||
@ -41,7 +53,6 @@ def cli():
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
# NOTE: this is the main bench command
|
|
||||||
bench_command()
|
bench_command()
|
||||||
except PatchError:
|
except PatchError:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -13,7 +13,6 @@ def print_bench_version(ctx, param, value):
|
|||||||
@click.group()
|
@click.group()
|
||||||
@click.option('--version', is_flag=True, is_eager=True, callback=print_bench_version, expose_value=False)
|
@click.option('--version', is_flag=True, is_eager=True, callback=print_bench_version, expose_value=False)
|
||||||
def bench_command(bench_path='.'):
|
def bench_command(bench_path='.'):
|
||||||
"""Bench manager for Frappe"""
|
|
||||||
import bench
|
import bench
|
||||||
from bench.utils import setup_logging
|
from bench.utils import setup_logging
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ def setup_sudoers(user):
|
|||||||
|
|
||||||
def setup_logging(bench_path='.'):
|
def setup_logging(bench_path='.'):
|
||||||
if os.path.exists(os.path.join(bench_path, 'logs')):
|
if os.path.exists(os.path.join(bench_path, 'logs')):
|
||||||
logger = logging.getLogger('bench')
|
logger = logging.getLogger(bench.PROJECT_NAME)
|
||||||
log_file = os.path.join(bench_path, 'logs', 'bench.log')
|
log_file = os.path.join(bench_path, 'logs', 'bench.log')
|
||||||
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
|
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
|
||||||
hdlr = logging.FileHandler(log_file)
|
hdlr = logging.FileHandler(log_file)
|
||||||
|
11
setup.py
11
setup.py
@ -1,22 +1,17 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
import re, ast
|
import re, ast
|
||||||
|
|
||||||
# get version from __version__ variable in bench/__init__.py
|
from bench import PROJECT_NAME, VERSION
|
||||||
_version_re = re.compile(r'__version__\s+=\s+(.*)')
|
|
||||||
|
|
||||||
with open('requirements.txt') as f:
|
with open('requirements.txt') as f:
|
||||||
install_requires = f.read().strip().split('\n')
|
install_requires = f.read().strip().split('\n')
|
||||||
|
|
||||||
with open('bench/__init__.py', 'rb') as f:
|
|
||||||
version = str(ast.literal_eval(_version_re.search(
|
|
||||||
f.read().decode('utf-8')).group(1)))
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='bench',
|
name=PROJECT_NAME,
|
||||||
description='Metadata driven, full-stack web framework',
|
description='Metadata driven, full-stack web framework',
|
||||||
author='Frappe Technologies',
|
author='Frappe Technologies',
|
||||||
author_email='info@frappe.io',
|
author_email='info@frappe.io',
|
||||||
version=version,
|
version=VERSION,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user