This repository has been archived by the owner on Dec 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathsetup.py
47 lines (41 loc) · 1.77 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
import sys
import requests.certs
import py_compile
from cx_Freeze import setup, Executable
zip_includes = []
includes = ["atexit", "re", "sip"]
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = "Win32GUI"
prawIniLoc = 'C:/Python34/Lib/site-packages/praw/praw.ini'
targetName = 'redditDataExtractor.exe'
else:
prawIniLoc = '/usr/local/lib/python3.4/site-packages/praw/praw.ini'
# for some reason my computer couldn't find ntpath.py to include it in the zip
py_compile.compile('/usr/local/lib/python3.4/ntpath.py', cfile='ntpath.pyc')
zip_includes = ['ntpath.pyc']
targetName = 'redditDataExtractor'
packages = []
for dbmodule in ['dbhash', 'gdbm', 'dbm', 'dumbdbm']:
try:
__import__(dbmodule)
except ImportError:
pass
else:
# If we found the module, ensure it's copied to the build directory.
packages.append(dbmodule)
include_files = [('RedditDataExtractor/images', 'RedditDataExtractor/images'), (requests.certs.where(),'RedditDataExtractor/cacert.pem'), (prawIniLoc, 'praw.ini')]
setup(
name='RedditDataExtractor',
version='1.0',
packages=['test', 'RedditDataExtractor', 'RedditDataExtractor.GUI'],
url='',
license='GNU GPLv3',
author='J Nicolas Schrading',
author_email='[email protected]',
description='The reddit Data Extractor is a GUI tool for downloading almost any content posted to reddit.',
options = {"build_exe": {'includes': includes, 'packages': packages, 'include_files': include_files, 'zip_includes': zip_includes, 'copy_dependent_files': True, 'icon': 'RedditDataExtractor/images/logo.ico'}},
executables = [Executable("main.py", base=base, targetName=targetName)]
)