forked from moses-palmer/pynput
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
123 lines (98 loc) · 3.18 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env python
# coding: utf-8
import os
import setuptools
#: The name of the package on PyPi
PYPI_PACKAGE_NAME = 'pynput'
#: The name of the main Python package
MAIN_PACKAGE_NAME = 'pynput'
#: The package URL
PACKAGE_URL = 'https://github.com/moses-palmer/pynput'
#: The author email
AUTHOR_EMAIL = '[email protected]'
#: The runtime requirements
RUNTIME_PACKAGES = [
'six']
#: Additional requirements used during setup
SETUP_PACKAGES = [
'setuptools-lint >=0.5',
'sphinx >=1.3.1']
#: Packages requires for different environments
EXTRA_PACKAGES = {
':sys_platform == "darwin"': [
'pyobjc-framework-Quartz >=3.0'],
':"linux" in sys_platform': [
'python-xlib >= 0.17'],
':python_version == "2.7"': [
'enum34']}
# Read globals from ._info without loading it
INFO = {}
with open(os.path.join(
os.path.dirname(__file__),
'lib',
MAIN_PACKAGE_NAME,
'_info.py')) as f:
for line in f:
try:
name, value = (i.strip() for i in line.split('='))
if name.startswith('__') and name.endswith('__'):
INFO[name[2:-2]] = eval(value)
except ValueError:
pass
# Load the read me
try:
with open(os.path.join(
os.path.dirname(__file__),
'README.rst')) as f:
README = f.read()
with open(os.path.join(
os.path.dirname(__file__),
os.path.join('docs', 'mouse-usage.rst'))) as f:
README += '\n\n' + f.read()
with open(os.path.join(
os.path.dirname(__file__),
os.path.join('docs', 'keyboard-usage.rst'))) as f:
README += '\n\n' + f.read()
except IOError:
README = ''
# Load the release notes
try:
with open(os.path.join(
os.path.dirname(__file__),
'CHANGES.rst')) as f:
CHANGES = f.read()
except IOError:
CHANGES = ''
setuptools.setup(
name=PYPI_PACKAGE_NAME,
version='.'.join(str(i) for i in INFO['version']),
description='Monitor and control user input devices',
long_description=README + '\n\n' + CHANGES,
install_requires=RUNTIME_PACKAGES,
setup_requires=RUNTIME_PACKAGES + SETUP_PACKAGES,
extras_require=EXTRA_PACKAGES,
author=INFO['author'],
author_email=AUTHOR_EMAIL,
url=PACKAGE_URL,
packages=setuptools.find_packages(
os.path.join(
os.path.dirname(__file__),
'lib')),
package_dir={'': 'lib'},
zip_safe=True,
test_suite='tests',
license='LGPLv3',
keywords='control mouse, mouse input, control keyboard, keyboard input',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v3 '
'(LGPLv3)',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows :: Windows NT/2000',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Monitoring'])