-
Notifications
You must be signed in to change notification settings - Fork 26
/
setup.py
58 lines (52 loc) · 1.29 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
"""Package script for this plugin."""
import string
from pathlib import Path
from setuptools import setup
from version import version
# get the root directory of this plugin
ROOT_DIR = Path(__file__).resolve().parent
# use the name of the root directory as the plugin id
PLUGIN_ID = ROOT_DIR.name
# write the INFO file for this plugin
INFO_TMPL = """
{
"id": "${plugin_id}-${version}",
"entry_file": "run.sh",
"type": ["movie", "tvshow"],
"language": ["chs"],
"test_example": {
"movie": {
"title": "--install"
},
"tvshow": {
"title": "--install"
},
"tvshow_episode": {
"title": "--install",
"season": 1,
"episode": 1
}
}
}
"""
with open(ROOT_DIR / "INFO", "w", encoding="utf-8") as writer:
template = string.Template(INFO_TMPL)
writer.write(template.substitute(plugin_id=PLUGIN_ID, version=version()))
# use 'python setup.py sdist --formats=zip' command to create the zip file
setup(
name=PLUGIN_ID,
version=version(),
packages=[
"",
"scraper",
"scraper.functions",
"scrapeflows",
"configserver"
],
package_data={
"": ["run.sh", "resolvers.conf", "INFO"],
"scrapeflows": ["*.json"],
"configserver": ["templates/*.html"],
},
python_requires=">=3.6",
)