mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
fix: add playbooks in the python package
This commit is contained in:
parent
e791410a31
commit
78e1f03cc4
@ -359,7 +359,7 @@ def run_playbook(playbook_name, sudo=False, extra_vars=None):
|
||||
else:
|
||||
cwd = os.path.join(os.path.expanduser('~'), 'bench')
|
||||
|
||||
success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'), stdout=log_stream, stderr=sys.stderr)
|
||||
success = subprocess.check_call(args, cwd=os.path.join(cwd, 'bench', 'playbooks'), stdout=log_stream, stderr=sys.stderr)
|
||||
return success
|
||||
|
||||
|
@ -961,7 +961,7 @@ def run_playbook(playbook_name, extra_vars=None, tag=None):
|
||||
if tag:
|
||||
args.extend(['-t', tag])
|
||||
|
||||
subprocess.check_call(args, cwd=os.path.join(os.path.dirname(bench.__path__[0]), 'playbooks'))
|
||||
subprocess.check_call(args, cwd=os.path.join(bench.__path__[0], 'playbooks'))
|
||||
|
||||
|
||||
def find_benches(directory=None):
|
||||
|
12
setup.py
12
setup.py
@ -1,13 +1,16 @@
|
||||
from setuptools import setup, find_packages
|
||||
import re, ast
|
||||
import ast
|
||||
import os
|
||||
import re
|
||||
|
||||
# get version from __version__ variable in bench/__init__.py
|
||||
_version_re = re.compile(r'__version__\s+=\s+(.*)')
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
playbooks_files = [os.path.join(dp, f) for dp, dn, filenames in os.walk("playbooks") for f in filenames]
|
||||
|
||||
with open('requirements.txt') as f:
|
||||
install_requires = f.read().strip().split('\n')
|
||||
|
||||
with open('bench/__init__.py', 'rb') as f:
|
||||
_version_re = re.compile(r'__version__\s+=\s+(.*)')
|
||||
version = str(ast.literal_eval(_version_re.search(
|
||||
f.read().decode('utf-8')).group(1)))
|
||||
|
||||
@ -21,6 +24,7 @@ setup(
|
||||
zip_safe=False,
|
||||
include_package_data=True,
|
||||
install_requires=install_requires,
|
||||
package_data={ 'bench': playbooks_files },
|
||||
entry_points='''
|
||||
[console_scripts]
|
||||
bench=bench.cli:cli
|
||||
|
Loading…
Reference in New Issue
Block a user