mirror of
https://github.com/frappe/bench.git
synced 2024-11-12 00:06:36 +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
|
||||
|
||||
__version__ = "4.1.0"
|
||||
|
||||
VERSION = "5.0.0"
|
||||
PROJECT_NAME = "frappe-bench"
|
||||
FRAPPE_VERSION = None
|
||||
__version__ = VERSION
|
||||
env = Environment(loader=PackageLoader('bench.config'))
|
||||
|
||||
FRAPPE_VERSION = None
|
||||
|
||||
def set_frappe_version(bench_path='.'):
|
||||
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:
|
||||
update_requirements()
|
||||
update_node_packages()
|
||||
reload_module(utils)
|
||||
reload_module(bench.utils)
|
||||
backup_all_sites()
|
||||
patch_sites()
|
||||
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 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.config.common_site_config import get_config
|
||||
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
|
||||
change_uid_msg = "You should not run this command as root"
|
||||
|
||||
|
||||
def cli():
|
||||
global from_command_line
|
||||
from_command_line = True
|
||||
@ -19,7 +31,7 @@ def cli():
|
||||
change_dir()
|
||||
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)
|
||||
|
||||
if len(sys.argv) > 2 and sys.argv[1] == "frappe":
|
||||
@ -41,7 +53,6 @@ def cli():
|
||||
|
||||
else:
|
||||
try:
|
||||
# NOTE: this is the main bench command
|
||||
bench_command()
|
||||
except PatchError:
|
||||
sys.exit(1)
|
||||
|
@ -13,7 +13,6 @@ def print_bench_version(ctx, param, value):
|
||||
@click.group()
|
||||
@click.option('--version', is_flag=True, is_eager=True, callback=print_bench_version, expose_value=False)
|
||||
def bench_command(bench_path='.'):
|
||||
"""Bench manager for Frappe"""
|
||||
import bench
|
||||
from bench.utils import setup_logging
|
||||
|
||||
|
@ -412,7 +412,7 @@ def setup_sudoers(user):
|
||||
|
||||
def setup_logging(bench_path='.'):
|
||||
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')
|
||||
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
|
||||
hdlr = logging.FileHandler(log_file)
|
||||
|
11
setup.py
11
setup.py
@ -1,22 +1,17 @@
|
||||
from setuptools import setup, find_packages
|
||||
import re, ast
|
||||
|
||||
# get version from __version__ variable in bench/__init__.py
|
||||
_version_re = re.compile(r'__version__\s+=\s+(.*)')
|
||||
from bench import PROJECT_NAME, VERSION
|
||||
|
||||
with open('requirements.txt') as f:
|
||||
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(
|
||||
name='bench',
|
||||
name=PROJECT_NAME,
|
||||
description='Metadata driven, full-stack web framework',
|
||||
author='Frappe Technologies',
|
||||
author_email='info@frappe.io',
|
||||
version=version,
|
||||
version=VERSION,
|
||||
packages=find_packages(),
|
||||
zip_safe=False,
|
||||
include_package_data=True,
|
||||
|
Loading…
Reference in New Issue
Block a user