-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
94 lines (77 loc) · 2.19 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
import os
import setuptools
import subprocess
import sys
def shell_command(command, short_description):
"""Create a simple command that is invoked using subprocess."""
class ShellCommand(setuptools.Command):
"""Run custom script when invoked."""
description = short_description
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
subprocess.call(command)
return ShellCommand
def unittest_command(suite):
"""Get new command for unittest suite."""
return [
sys.executable,
"-m",
"unittest",
"discover",
"-v",
"-s",
suite,
"-p",
"*_test.py"
]
LICENSE = "Apache-2.0"
MAINTAINER = ['Alex Huszagh']
MAINTAINER_EMAIL = ['[email protected]']
NAME = "blockbot"
URL = "https://github.com/Alexhuszagh/blockbot.git"
VERSION = "0.0.1"
DESCRIPTION = "Automated utilities to block users on Twitter."
LONG_DESCRIPTION = """Sick of seeing fancams?
Dogpiled by followers of a certain user?
Blockbot has you covered: an open-source, scalable solution to help fix Twitter.
"""
PACKAGES = setuptools.find_packages()
HOME = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(HOME, 'requirements.txt')) as f:
REQUIRES = f.read().splitlines()
SCRIPTS = [os.path.join('scripts', i) for i in os.listdir('scripts')]
COMMANDS = {
'test': shell_command(
command=unittest_command("tests"),
short_description="Run unittest suite."
),
}
# Writeable configuration files to install.
DATA_FILES = [
(os.path.join(os.path.expanduser('~'), '.blockbot', 'config'), [
'config/api.json',
'config/block_followers.json',
'config/block_media_replies.json',
]),
]
setuptools.setup(
install_requires=REQUIRES,
python_requires=">=3.7",
scripts=SCRIPTS,
data_files=DATA_FILES,
packages=PACKAGES,
cmdclass=COMMANDS,
zip_safe=False,
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
url=URL,
license=LICENSE,
)