forked from tazjel/declaracad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.py
More file actions
130 lines (115 loc) · 3.84 KB
/
release.py
File metadata and controls
130 lines (115 loc) · 3.84 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
"""
Copyright (c) 2017, Jairus Martin.
Distributed under the terms of the GPL v3 License.
The full license is in the file COPYING.txt, distributed with this software.
Created on Dec 5, 2017
@author
"""
import os
import sys
import importlib
from glob import glob
from os.path import dirname, split
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
def patch():
#: Patch zope to include an __init__.py file
#: idk what person thought leaving it out was a good idea
mod = importlib.import_module('zope')
zope_dir = dirname(mod.__file__)
__init__py = os.path.join(zope_dir, '__init__.py')
if not os.path.exists(__init__py):
with open(__init__py, 'w') as f:
pass
def find_enaml_files(*modules):
""" Find .enaml files to include in the zip """
files = {}
for name in modules:
mod = importlib.import_module(name)
mod_path = dirname(mod.__file__)
pkg_root = dirname(mod_path)
for file_type in ['enaml', 'png']:
for f in glob('{}/**/*.{}'.format(mod_path, file_type),
recursive=True):
pkg = f.replace(pkg_root+os.path.sep, '')
files[f] = pkg
return files.items()
def find_data_files(*modules):
files = {}
for name in modules:
mod = importlib.import_module(name)
mod_path = name#mod.__file__# if hasattr(mod, '__file__') else name
pkg_root = name#dirname(mod_path)
for f in glob('{}/**/*.png'.format(mod_path), recursive=True):
pkg = f.replace(pkg_root+os.path.sep, '')
files[f] = pkg
return files.items()
patch()
setup(
name='dceclaracad',
author="CodeLV",
author_email="frmdstryr@gmail.com",
license='GPLv3',
url='https://github.com/codelv/declaracad/',
description="A declarative parametric 3D modeling application",
long_description=open("README.md").read(),
version='1.0',
options=dict(
build_exe=dict(
packages=[
'declaracad',
'enaml',
'enamlx',
'qt5reactor',
'pygments',
'ipykernel',
'zmq'
],
zip_include_packages=[
'atom',
'asn1crypto', 'asyncio', 'attr', 'autobahn', 'automat',
'collections', 'concurrent', 'constantly', 'ctypes', 'curses',
'cffi', 'cryptography',
'dateutil', 'dbm', 'distutils',
'email', 'enaml', 'enamlx', 'encodings',
'future',
'html', 'http',
'idna', 'importlib', 'incremental', 'ipykernel', 'IPython',
'ipython_genutils',
'jedi', 'json', 'jsonpickle', 'jupyter_client', 'jupyter_core',
#'lib2to3',
'logging', 'libfuturize',
#'micropyde',
'multiprocessing',
'OpenSSL',
'parso', 'past', 'pexpect', 'pkg_resources', 'ply',
'prompt_toolkit', 'ptyprocess', 'pydoc_data', 'pyflakes',
'pygments', 'pycparser',
'qtconsole', 'qt5reactor', 'qtpy',
'sqlite3', 'setuptools', 'serial',
'traitlets', 'twisted', 'traitlets', 'txaio', 'tornado',
'tkinter', 'test',
'unittest', 'urllib',
'wcwidth',
'xml', 'xmlrpc',
'zope',
#'zmq',
],
zip_includes=find_enaml_files(
#'micropyde',
'enaml',
),
excludes=[
'enaml.core.byteplay.byteplay2',
'enamlx.qt.qt_occ_viewer',
#'lib2to3',
],
)
),
executables=[
Executable('main.py',
targetName='declaracad',
base='Win32GUI' if sys.platform == 'win32' else None)
]
)