-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py.old
89 lines (68 loc) · 2.44 KB
/
setup.py.old
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
import os
import shutil
from setuptools import setup
from setuptools import find_packages
#
# Modify these values to fork a new plugin
#
author = "Synerty"
author_email = "[email protected]"
py_package_name = "peek_plugin_livedb"
pip_package_name = py_package_name.replace("_", "-")
package_version = "0.0.0"
description = "Peek Plugin LiveDB - My first enhancement."
download_url = "https://bitbucket.org/synerty/%s/get/%s.zip"
download_url %= pip_package_name, package_version
url = "https://bitbucket.org/synerty/%s" % pip_package_name
#
# Everything below should be ok
#
egg_info = "%s.egg-info" % pip_package_name
if os.path.isdir(egg_info):
shutil.rmtree(egg_info)
if os.path.isfile("MANIFEST"):
os.remove("MANIFEST")
excludePathContains = ("__pycache__", "node_modules", "platforms", "dist")
excludeFilesEndWith = (".pyc", ".js", ".js.map", ".lastHash")
excludeFilesStartWith = ()
def find_package_files():
paths = []
for (path, directories, filenames) in os.walk(py_package_name):
if [e for e in excludePathContains if e in path]:
continue
for filename in filenames:
if [e for e in excludeFilesEndWith if filename.endswith(e)]:
continue
if [e for e in excludeFilesStartWith if filename.startswith(e)]:
continue
paths.append(os.path.join(path[len(py_package_name) + 1 :], filename))
return paths
package_files = find_package_files()
###############################################################################
# Define the dependencies
# Ensure the dependency is the same major number
# and no older then this version
requirements = ["peek-plugin-base"]
# Force the dependencies to be the same branch
reqVer = ".".join(package_version.split(".")[0:2]) + ".*"
# >=2.0.*,>=2.0.6
requirements = [
"%s==%s,>=%s" % (pkg, reqVer, package_version.split("+")[0]) if pkg.startswith("peek") else pkg
for pkg in requirements
]
###############################################################################
# Call the setuptools
setup(
name=pip_package_name,
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
package_data={"": package_files},
install_requires=requirements,
version=package_version,
description=description,
author=author,
author_email=author_email,
url=url,
download_url=download_url,
keywords=["Peek", "Python", "Platform", "synerty"],
classifiers=[],
)