-
Notifications
You must be signed in to change notification settings - Fork 29
/
cxfreeze_setup.py
73 lines (61 loc) · 2.22 KB
/
cxfreeze_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
from os.path import basename, join
import pkg_resources
from cx_Freeze import Executable, setup
from gparch import VERSION
"""
Archiver For Google Photos
- A tool to maintain an archive/mirror of your Google Photos library for backup purposes.
Copyright (C) 2021 Nicholas Dawson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
def collect_dist_info(packages):
"""
Recursively collects the path to the packages' dist-info.
From: https://github.com/marcelotduarte/cx_Freeze/issues/438#issuecomment-472954154
"""
if not isinstance(packages, list):
packages = [packages]
dirs = []
for pkg in packages:
distrib = pkg_resources.get_distribution(pkg)
for req in distrib.requires():
dirs.extend(collect_dist_info(req.key))
dirs.append((distrib.egg_info, join("Lib", basename(distrib.egg_info))))
return dirs
# Dependencies
build_exe_options = {
"packages": [
"io",
"json",
"os",
"pickle",
"multiprocessing",
"piexif",
"google.auth.transport.requests",
"google_auth_oauthlib.flow",
"googleapiclient.discovery",
"httplib2",
"PIL",
"tqdm",
"pkg_resources",
],
"include_files": collect_dist_info("google_api_python_client") + ["gparch.py"]
}
base = None
setup(
name="Archiver for Google Photos (CLI)",
version=VERSION,
description="A tool to maintain an archive/mirror of your Google Photos library for backup purposes.",
options={"build_exe": build_exe_options},
executables=[Executable("gparch_cli.py", base=base)],
py_modules=[]
)