Skip to content

Commit f617572

Browse files
committed
Fixes for installation through pip.
1 parent 84a774e commit f617572

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

setup.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
from distutils.core import setup
66
from setuptools import find_packages
77

8-
def get_requirements():
9-
with open('requirements.txt', 'r') as f:
10-
return f.read().splitlines()
11-
128
def get_long_description():
139
path = os.path.join(os.path.dirname(__file__), 'README.md')
1410
with open(path) as f:
@@ -21,7 +17,7 @@ def get_data_files(path, strip='', prefix=''):
2117
data_files = []
2218
for dirpath, dirnames, filenames in os.walk(path):
2319
files = [os.path.join(dirpath, filename) for filename in filenames]
24-
data_files.append( (prefix + dirpath[len(strip):], files) )
20+
data_files.append( [prefix + dirpath[len(strip):], files] )
2521
return data_files
2622

2723

@@ -32,7 +28,6 @@ def get_data_files(path, strip='', prefix=''):
3228
print(' git push --tags')
3329
sys.exit()
3430

35-
3631
setup(
3732
name='ansible-cmdb',
3833
version=get_version(),
@@ -47,11 +42,15 @@ def get_data_files(path, strip='', prefix=''):
4742
package_dir={'': 'src'},
4843
packages=find_packages('src'),
4944
include_package_data=True,
50-
data_files=get_data_files('src/ansiblecmdb/data',
51-
strip='src',
52-
prefix='lib/'),
45+
data_files=\
46+
get_data_files(
47+
'src/ansiblecmdb/data',
48+
strip='src',
49+
prefix='lib'
50+
) +
51+
[['lib/ansiblecmdb/', ['src/ansible-cmdb.py']]],
5352
zip_safe=False,
54-
install_requires=get_requirements(),
53+
install_requires=['mako', 'pyyaml', 'ushlex', 'jsonxs'],
5554
scripts=[
5655
'src/ansible-cmdb',
5756
],

src/ansible-cmdb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ if [ -f "$BIN_DIR/ansible-cmdb.py" ]; then
2525
ANSIBLE_CMDB="$BIN_DIR/ansible-cmdb.py"
2626
elif [ -f "$BIN_DIR/../lib/ansible-cmdb/ansible-cmdb.py" ]; then
2727
ANSIBLE_CMDB="$BIN_DIR/../lib/ansible-cmdb/ansible-cmdb.py"
28+
elif [ -f "$BIN_DIR/../lib/ansiblecmdb/ansible-cmdb.py" ]; then
29+
ANSIBLE_CMDB="$BIN_DIR/../lib/ansiblecmdb/ansible-cmdb.py"
2830
else
29-
echo "Couldn't find $BIN_DIR/ansible-cmdb.py in . or $BIN_DIR/../lib/ansible-cmdb (cwd=$PWD)" >&2
31+
echo "Couldn't find $BIN_DIR/ansible-cmdb.py in . or $BIN_DIR/../lib/ansible-cmdb/ or $BIN_DIR/../lib/ansiblecmdb/ (cwd=$PWD)" >&2
3032
exit 2
3133
fi
3234

0 commit comments

Comments
 (0)