Skip to content

Commit

Permalink
chore: update cx_freeze setup to pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieboldianus committed Jan 29, 2019
1 parent ded0591 commit 95c5e19
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions cx_setup.py
Expand Up @@ -2,8 +2,13 @@

"""Setup config for cx_freeze (built)"""

import distutils
import os.path
from cx_Freeze import setup, Executable
import sys

from cx_Freeze import Executable, setup

import opcode

# Derive Package Paths Dynamically
PYTHON_INSTALL_DIR = os.path.dirname(
Expand All @@ -13,6 +18,11 @@
os.environ['TK_LIBRARY'] = os.path.join(
PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')

# opcode is not a virtualenv module,
# so we can use it to find the stdlib; this is the same
# trick used by distutils itself it installs itself into the virtualenv
DISTUTILS_PATH = os.path.join(os.path.dirname(opcode.__file__), 'distutils')

VERSION_DICT = {}
with open("tagmaps/version.py") as fp:
exec(fp.read(), VERSION_DICT) # pylint: disable=W0122
Expand All @@ -28,12 +38,26 @@
'seaborn.cm',
'scipy.sparse.csgraph',
'argparse',
'scipy.sparse.csgraph._validation'
'scipy.sparse.csgraph._validation',
'numpy.core._dtype_ctypes',
'scipy._distributor_init',
'multiprocessing'
]

# windows pipenv:
# copy tcl86t.dll, tk86t.dll and sqlite3.dll
# to venv_folder/DLLs/*
INCLUDE_FOLDERS_FILES = [
"C:/Python36/DLLs/tcl86t.dll",
"C:/Python36/DLLs/tk86t.dll",
(DISTUTILS_PATH, 'distutils'),
(os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
os.path.join('lib', 'tcl86t.dll'),
),
(os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join('lib', 'tk86t.dll'),
),
(os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'sqlite3.dll'),
os.path.join('lib', 'sqlite3.dll'),
),
'resources/01_Input/',
'resources/00_Config/',
'resources/00_generateClusters_OnlyEmoji.cmd',
Expand All @@ -43,7 +67,9 @@
"matplotlibrc")
]
PACKAGES_MOD = ["tkinter", "hdbscan"]
EXCLUDES_MOD = ["scipy.spatial.cKDTree"]
EXCLUDES_MOD = [
"scipy.spatial.cKDTree",
"distutils"]


# GUI applications require a different base on Windows
Expand All @@ -65,6 +91,6 @@
'include_files': INCLUDE_FOLDERS_FILES,
'packages': PACKAGES_MOD,
'excludes': EXCLUDES_MOD,
'optimize': 2}
'optimize': 0}
},
executables=EXECUTABLES)

0 comments on commit 95c5e19

Please sign in to comment.