|
1 | 1 | #!/usr/bin/env python |
2 | 2 | from setuptools import setup |
3 | | -import os |
4 | 3 | import sys |
5 | | -import tempfile |
6 | | - |
7 | | -for path in os.environ['PATH'].split(':'): |
8 | | - target = os.path.join(os.path.dirname(path), 'etc', 'bash_completion.d') |
9 | | - if os.path.isdir(target): |
10 | | - break |
11 | | -else: |
12 | | - # Fall back to the default used by many Linux distros |
13 | | - target = '/etc/bash_completion.d' |
14 | | - |
15 | | -try: |
16 | | - with tempfile.TemporaryFile(dir=target) as t: |
17 | | - pass |
18 | | -except OSError as e: |
19 | | - print( |
20 | | -'''****************************************************************************** |
21 | | -Pythonpy was not able to install bash completion because it does not have write |
22 | | -access to /etc/bash_completion.d. |
23 | | -If you would still like to install bash completion, either: |
24 | | -1) Reinstall with `sudo pip install pythonpy` |
25 | | -2) Configure tab completion manually: |
26 | | - source /path/to/virtualenv/bash_completion.d/pycompletion.sh |
27 | | -
|
28 | | -Installation proceeding without root access... |
29 | | -******************************************************************************''') |
30 | | - target='bash_completion.d' |
31 | | - |
32 | | -data_files = [(target, ['pythonpy/pycompletion.sh']),] |
33 | 4 |
|
34 | 5 | py_entry = 'py%s = pythonpy.__main__:main' |
35 | 6 | pycompleter_entry = 'pycompleter%s = pythonpy.pycompleter:main' |
|
43 | 14 | name='pythonpy', |
44 | 15 | version='0.4.4', |
45 | 16 | description='python -c, with tab completion and shorthand', |
46 | | - data_files=data_files, |
| 17 | + #data_files=data_files, |
47 | 18 | license='MIT', |
48 | 19 | url='https://github.com/Russell91/pythonpy', |
49 | 20 | long_description='https://github.com/Russell91/pythonpy', |
50 | | - packages = ['pythonpy'], |
| 21 | + packages=['pythonpy'], |
| 22 | + package_data={'pythonpy': ['data/pycompletion.sh']}, |
51 | 23 | entry_points = { |
52 | 24 | 'console_scripts': entry_points_scripts |
53 | 25 | }, |
|
0 commit comments