-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
75 lines (61 loc) · 2.75 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
# -*- coding: utf-8 -*-
"""
Setup.py for InputScope.
@author Erki Suurjaak
@created 29.04.2015
@modified 10.07.2023
------------------------------------------------------------------------------
"""
import os
import re
import sys
import setuptools
ROOTPATH = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(ROOTPATH, "src"))
from inputscope import conf
PACKAGE = conf.Title.lower()
def readfile(path):
"""Returns contents of path, relative to current file."""
root = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(root, path)) as f: return f.read()
def get_description():
"""Returns package description from README."""
LINK_RGX = r"\[([^\]]+)\]\(([^\)]+)\)" # 1: content in [], 2: content in ()
linkify = lambda s: "#" + re.sub(r"[^\w -]", "", s).lower().replace(" ", "-")
# Unwrap local links like [Page link](#page-link) and [LICENSE.md](LICENSE.md)
repl = lambda m: m.group(1 if m.group(2) in (m.group(1), linkify(m.group(1))) else 0)
return re.sub(LINK_RGX, repl, readfile("README.md"))
setuptools.setup(
name = conf.Title,
version = conf.Version,
description = "Mouse and keyboard input heatmap visualizer and statistics",
url = "https://github.com/suurjaak/InputScope",
author = "Erki Suurjaak",
author_email = "[email protected]",
license = "MIT",
platforms = ["any"],
keywords = "mouse keyboard logging heatmap",
install_requires = ["bottle", "psutil", "pynput", "wxPython>=4.0"],
entry_points = {"gui_scripts": ["{0} = {0}.main:main".format(PACKAGE)],
"console_scripts": ["{0}-listener = {0}.listener:main".format(PACKAGE),
"{0}-webui = {0}.webui:main".format(PACKAGE)]},
package_dir = {"": "src"},
packages = [PACKAGE],
include_package_data = True, # Use MANIFEST.in for data files
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Operating System :: MacOS",
"Topic :: Desktop Environment",
"Topic :: System :: Monitoring",
"Topic :: Utilities",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
],
long_description_content_type = "text/markdown",
long_description = get_description(),
)