This repository has been archived by the owner on Aug 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
/
setup.py
76 lines (65 loc) · 2.07 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python
from setuptools import setup
import os
import sys
__doc__ = """
Command line tool and library wrappers around iwlist and
/etc/network/interfaces.
"""
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
install_requires = [
'setuptools',
'pbkdf2',
]
try:
import argparse
except:
install_requires.append('argparse')
version = '1.0.0'
should_install_cli = os.environ.get('WIFI_INSTALL_CLI') not in ['False', '0']
command_name = os.environ.get('WIFI_CLI_NAME', 'wifi')
if command_name == 'wifi.py':
print(
"Having a command name of wifi.py will result in a weird ImportError"
" that doesn't seem possible to work around. Pretty much any other"
" name seems to work though."
)
sys.exit(1)
entry_points = {}
data_files = []
if should_install_cli:
entry_points['console_scripts'] = [
'{command} = wifi.cli:main'.format(command=command_name),
]
# make sure we actually have write access to the target folder and if not don't
# include it in data_files
if os.access('/etc/bash_completion.d/', os.W_OK):
data_files.append(('/etc/bash_completion.d/', ['extras/wifi-completion.bash']))
else:
print("Not installing bash completion because of lack of permissions.")
setup(
name='wifi',
version=version,
author='Rocky Meza, Gavin Wahl',
author_email='[email protected]',
description=__doc__,
long_description='\n\n'.join([read('README.rst'), read('CHANGES.rst')]),
packages=['wifi'],
entry_points=entry_points,
test_suite='tests',
platforms=["Debian"],
license='BSD',
install_requires=install_requires,
classifiers=[
"License :: OSI Approved :: BSD License",
"Topic :: System :: Networking",
"Operating System :: POSIX :: Linux",
"Environment :: Console",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
],
data_files=data_files
)