Skip to content

Commit

Permalink
revert exe/invest.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
dcdenu4 committed Oct 31, 2024
1 parent 8136fdd commit cd6608f
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions exe/invest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ from PyInstaller.compat import is_win, is_darwin
# Global Variables
current_dir = os.getcwd() # assume we're building from the project root
block_cipher = None
invest_exename = 'invest'
jupyter_exename = 'jupyter'
exename = 'invest'
conda_env = os.environ['CONDA_PREFIX']

if is_win:
Expand Down Expand Up @@ -42,14 +41,8 @@ kwargs = {
cli_file = os.path.join(current_dir, 'src', 'natcap', 'invest', 'cli.py')
a = Analysis([cli_file], **kwargs)

jupyter_cli_file = os.path.join(conda_env, 'Scripts', 'jupyter-script.py')
b = Analysis([jupyter_cli_file], pathex=sys.path, excludes=None)

MERGE((a, 'invest', 'invest'), (b, 'jupyter', 'jupyter'))

# Compress pyc and pyo Files into ZlibArchive Objects
a_pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
b_pyz = PYZ(b.pure, b.zipped_data, cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

# Create the executable file.
if is_darwin:
Expand Down Expand Up @@ -83,23 +76,12 @@ elif is_win:
(os.path.join('rtree', os.path.basename(name)), name, "BINARY") for name in
glob.glob(os.path.join(conda_env, 'Library', 'bin', 'spatialindex*.dll'))]
# .exe extension is required if we're on windows.
invest_exename += '.exe'
jupyter_exename += '.exe'
exename += '.exe'

a_exe = EXE(
a_pyz,
exe = EXE(
pyz,
a.scripts,
name=invest_exename,
exclude_binaries=True,
debug=False,
strip=False,
upx=False,
console=True)

b_exe = EXE(
b_pyz,
b.scripts,
name=jupyter_exename,
name=exename,
exclude_binaries=True,
debug=False,
strip=False,
Expand All @@ -108,14 +90,10 @@ b_exe = EXE(

# Collect Files into Distributable Folder/File
dist = COLLECT(
a_exe,
exe,
a.binaries,
a.zipfiles,
a.datas,
b_exe,
b.binaries,
b.zipfiles,
b.datas,
name="invest", # name of the output folder
strip=False,
upx=False)

0 comments on commit cd6608f

Please sign in to comment.