Skip to content

Commit

Permalink
Updated .spec files to handle versioneer
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Blumberg committed Jan 18, 2019
1 parent 42e63db commit 5fcb734
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 5 deletions.
23 changes: 22 additions & 1 deletion runsharp/SHARPpy-linux-redhat5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ sys.path.append("../")

import sharppy
import glob
from sharppy._version import get_versions

# Write the versions file using versioneer, because PyInstaller doesn't do this automatically
ver = get_versions()
ver = str(ver)
ver_fname = os.path.dirname(sharppy.__file__) + '/_version.py'
ver_file = open(ver_fname, 'w')
ver_file.write('def get_versions():\n')
ver_file.write(' return ' + ver)
ver_file.close()


a = Analysis(['SHARPpy.py'],
pathex=['/home/tsupinie/SHARPpy/runsharp'],
hiddenimports=['xml.etree.ElementTree', 'sharppy.io.pecan_decoder', 'sharppy.io.uwyo_decoder', 'datasources.available'],
hiddenimports=['xml.etree.ElementTree', 'sharppy.io.pecan_decoder', 'sharppy.io.spc_decoder', 'sharppy.io.buf_decoder', 'sharppy.io.uwyo_decoder', 'datasources.available', 'sharppy.sharptab.prof_collection'],
hookspath=None,
runtime_hooks=None)

Expand Down Expand Up @@ -47,3 +58,13 @@ exe = EXE(pyz,
strip=None,
upx=True,
console=False )


# Revert the _version.py file to its original version using git
import subprocess
subprocess.Popen(['git', 'checkout', '--', ver_fname])

# Revert the _version.py file to its original version using git
import subprocess
subprocess.Popen(['git', 'checkout', '--', ver_fname])

22 changes: 18 additions & 4 deletions runsharp/SHARPpy-osx.spec
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
# -*- mode: python -*-
# Compile using `pyinstaller SHARPpy-osx.spec --onefile --noconsole`

import sharppy
import glob
import sharppy
from sharppy._version import get_versions

# Write the versions file using versioneer, because PyInstaller doesn't do this automatically
ver = get_versions()
ver = str(ver)
ver_fname = os.path.dirname(sharppy.__file__) + '/_version.py'
ver_file = open(ver_fname, 'w')
ver_file.write('def get_versions():\n')
ver_file.write(' return ' + ver)
ver_file.close()

# Analyze the SHARPpy package to get dependencies, etc.
a = Analysis(['SHARPpy.py'],
pathex=['/Users/blumberg/SHARPpy/runsharp'],
hiddenimports=['xml.etree.ElementTree', 'sharppy.io.pecan_decoder', 'sharppy.io.spc_decoder', 'sharppy.io.buf_decoder', 'sharppy.io.uwyo_decoder', 'datasources.available', 'sharppy.sharptab.prof_collection', 'dateutil.parser', 'requests'],
hiddenimports=['xml.etree.ElementTree', 'sharppy.io.pecan_decoder', 'sharppy.io.spc_decoder', 'sharppy.io.buf_decoder', 'sharppy.io.uwyo_decoder', 'datasources.available', 'sharppy.sharptab.prof_collection'],
hookspath=None,
runtime_hooks=None)

a.binaries = [x for x in a.binaries if not x[0].startswith("scipy")]
for b in a.binaries:
print(b)

a.datas += [("sharppy/databases/PW-mean-inches.txt", os.path.join(os.path.dirname(sharppy.__file__), "databases/PW-mean-inches.txt"), "DATA")]
a.datas += [("sharppy/databases/PW-stdev-inches.txt", os.path.join(os.path.dirname(sharppy.__file__), "databases/PW-stdev-inches.txt"), "DATA")]
Expand Down Expand Up @@ -56,3 +65,8 @@ app = BUNDLE(exe,
'NSHighResolutionCapable': 'True',
},
)

# Revert the _version.py file to its original version using git
import subprocess
subprocess.Popen(['git', 'checkout', '--', ver_fname])

16 changes: 16 additions & 0 deletions runsharp/SHARPpy-win7-32.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# -*- mode: python -*-
import glob
import sharppy
from sharppy._version import get_versions

# Write the versions file using versioneer, because PyInstaller doesn't do this automatically
ver = get_versions()
ver = str(ver)
ver_fname = os.path.dirname(sharppy.__file__) + '\\_version.py'
ver_file = open(ver_fname, 'w')
ver_file.write('def get_versions():\n')
ver_file.write(' return ' + ver)
ver_file.close()


a = Analysis(['SHARPpy.py'],
pathex=[r'C:\Users\Tim\SHARPpy\runsharp'],
Expand Down Expand Up @@ -54,3 +65,8 @@ exe = EXE(pyz,
upx=True,
console=False,
icon="icons\\SHARPpy.ico")

# Revert the _version.py file to its original version using git
import subprocess
subprocess.Popen(['git', 'checkout', '--', ver_fname])

16 changes: 16 additions & 0 deletions runsharp/SHARPpy-win7-64.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# -*- mode: python -*-
import glob
import sharppy
from sharppy._version import get_versions

# Write the versions file using versioneer, because PyInstaller doesn't do this automatically
ver = get_versions()
ver = str(ver)
ver_fname = os.path.dirname(sharppy.__file__) + "\\_version.py"
ver_file = open(ver_fname, 'w')
ver_file.write("def get_versions():\n")
ver_file.write(' return ' + ver)
ver_file.close()


a = Analysis(['SHARPpy.py'],
pathex=[r'C:\Users\Tim\SHARPpy\runsharp'],
Expand Down Expand Up @@ -49,3 +60,8 @@ exe = EXE(pyz,
strip=None,
upx=True,
console=False, icon='runsharp\\icons\\SHARPpy.ico')

# Revert the _version.py file to its original version using git
import subprocess
subprocess.Popen(['git', 'checkout', '--', ver_fname])

17 changes: 17 additions & 0 deletions runsharp/SHARPpy-win8-64.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# -*- mode: python -*-
import glob
import sharppy
from sharppy._version import get_versions

# Write the versions file using versioneer, because PyInstaller doesn't do this automatically
ver = get_versions()
ver = str(ver)
ver_fname = os.path.dirname(sharppy.__file__) + '\\_version.py'
ver_file = open(ver_fname, 'w')
ver_file.write('def get_versions():\n')
ver_file.write(' return ' + ver)
ver_file.close()


a = Analysis(['SHARPpy.py'],
pathex=[r'C:\Users\Tim\SHARPpy\runsharp'],
Expand Down Expand Up @@ -53,3 +64,9 @@ exe = EXE(pyz,
strip=None,
upx=True,
console=False, icon=None) #'radar.ico'


# Revert the _version.py file to its original version using git
import subprocess
subprocess.Popen(['git', 'checkout', '--', ver_fname])

0 comments on commit 5fcb734

Please sign in to comment.