Skip to content

Commit

Permalink
Merge pull request #158 from giumas/develop
Browse files Browse the repository at this point in the history
Cartopy's plotting extra requirements, modifications to pyinstaller specs, bug fix to avoid crash in case of geos loading issue
  • Loading branch information
giumas committed Apr 24, 2016
2 parents c32f6db + b5d42d7 commit 47fba58
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 33 deletions.
16 changes: 10 additions & 6 deletions HDFCompass.1file.spec
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ def collect_pkg_data(package, include_py_files=False, subdir=None):
return data_toc

pkg_data_hdf_compass = collect_pkg_data('hdf_compass')
pkg_data_lxml = collect_pkg_data('lxml') # temporary patch: https://github.com/pyinstaller/pyinstaller/issues/1613
cartopy_aux = collect_pkg_data('cartopy')
cartopy_aux = []
try: # for GeoArray we use cartopy that can be challenging to freeze on OSX to dependencies (i.e. geos)
import cartopy.crs as ccrs
cartopy_aux = collect_pkg_data('cartopy')
except (ImportError, OSError):
pass

if is_darwin:
icon_file = os.path.abspath('HDFCompass.icns')
Expand All @@ -60,12 +64,13 @@ else:
if not os.path.exists(icon_file):
raise RuntimeError("invalid path to icon: %s" % icon_file)

version = '0.6.0b2'
version = '0.6.0b3'
app_name = 'HDFCompass_' + version

a = Analysis(['HDFCompass.py'],
pathex=[],
hiddenimports=['scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack'], # for cartopy
hiddenimports=['scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack',
'scipy.linalg', 'scipy.integrate'], # for cartopy
excludes=["PySide"], # exclude libraries from being bundled (in case that are installed)
hookspath=None,
runtime_hooks=None)
Expand All @@ -77,10 +82,9 @@ exe = EXE(pyz,
a.zipfiles,
a.datas,
pkg_data_hdf_compass,
pkg_data_lxml,
cartopy_aux,
name=app_name,
debug=False,
debug=True,
strip=None,
upx=False,
console=True,
Expand Down
19 changes: 13 additions & 6 deletions HDFCompass.1folder.spec
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ def collect_pkg_data(package, include_py_files=False, subdir=None):
return data_toc

pkg_data_hdf_compass = collect_pkg_data('hdf_compass')
pkg_data_lxml = collect_pkg_data('lxml') # temporary patch: https://github.com/pyinstaller/pyinstaller/issues/1613
cartopy_aux = collect_pkg_data('cartopy')
cartopy_aux = []
try: # for GeoArray we use cartopy that can be challenging to freeze on OSX to dependencies (i.e. geos)
import cartopy.crs as ccrs
cartopy_aux = collect_pkg_data('cartopy')
except (ImportError, OSError):
pass

if is_darwin:
icon_file = os.path.abspath('HDFCompass.icns')
Expand All @@ -60,9 +64,13 @@ else:
if not os.path.exists(icon_file):
raise RuntimeError("invalid path to icon: %s" % icon_file)

version = '0.6.0b3'
app_name = 'HDFCompass_' + version

a = Analysis(['HDFCompass.py'],
pathex=[],
hiddenimports=['scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack'], # for cartopy
hiddenimports=['scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack',
'scipy.linalg', 'scipy.integrate'], # for cartopy
excludes=["PySide"], # exclude libraries from being bundled (in case that are installed)
hookspath=None,
runtime_hooks=None)
Expand All @@ -71,8 +79,8 @@ pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='HDFCompass',
debug=False,
name=app_name,
debug=True,
strip=None,
upx=True,
console=True,
Expand All @@ -82,7 +90,6 @@ coll = COLLECT(exe,
a.zipfiles,
a.datas,
pkg_data_hdf_compass,
pkg_data_lxml,
cartopy_aux,
strip=None,
upx=True,
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# General information about the project.
project = u'HDF Compass'
copyright = u'2015, The HDF Group'
copyright = u'2016, The HDF Group'
author = u'The HDF Group'

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -57,7 +57,7 @@
# The short X.Y version.
version = '0.6'
# The full version, including alpha/beta/rc tags.
release = '0.6.0b2'
release = '0.6.0b3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 3 additions & 3 deletions hdf_compass/bag_model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def can_handle(store, key):
# for GeoSurface we use cartopy that can be challenging to freeze on OSX to dependencies (i.e. geos)
try:
import cartopy.crs as ccrs
except ImportError:
except (ImportError, OSError):
return False
return (key == "/BAG_root/elevation") and (key in store) and (isinstance(store.f[key], h5py.Dataset))

Expand Down Expand Up @@ -388,7 +388,7 @@ def can_handle(store, key):
# for GeoSurface we use cartopy that can be challenging to freeze on OSX to dependencies (i.e. geos)
try:
import cartopy.crs as ccrs
except ImportError:
except (ImportError, OSError):
return False
# for GeoSurface we are using a matplotlib function present after 1.5.x
import matplotlib
Expand Down Expand Up @@ -705,7 +705,7 @@ def can_handle(store, key):
# for GeoSurface we use cartopy that can be challenging to freeze on OSX to dependencies (i.e. geos)
try:
import cartopy.crs as ccrs
except ImportError:
except (ImportError, OSError):
return False
return (key == "/BAG_root/uncertainty") and (key in store) and (isinstance(store.f[key], h5py.Dataset))

Expand Down
2 changes: 1 addition & 1 deletion hdf_compass/compass_viewer/geo_array/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
try: # for GeoArray we use cartopy that can be challenging to freeze on OSX to dependencies (i.e. geos)
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
except ImportError:
except (ImportError, OSError):
pass
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
Expand Down
2 changes: 1 addition & 1 deletion hdf_compass/compass_viewer/geo_surface/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
try: # for GeoSurface we use cartopy that can be challenging to freeze on OSX to dependencies (i.e. geos)
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
except ImportError:
except (ImportError, OSError):
pass
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
Expand Down
2 changes: 1 addition & 1 deletion hdf_compass/compass_viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def load_plugins():
log.debug("lxml %s (libxml %s, libxslt %s)"
% (etree.__version__, ".".join(str(i) for i in etree.LIBXML_VERSION),
".".join(str(i) for i in etree.LIBXSLT_VERSION)))
except ImportError:
except (ImportError, OSError):
log.warning("BAG plugin: NOT loaded")

try:
Expand Down
2 changes: 1 addition & 1 deletion hdf_compass/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
from .utils import is_darwin, is_win, is_linux, url2path, path2url, data_url


__version__ = "0.6.0b2"
__version__ = "0.6.0b3"
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
current_version = 0.6.0b2
current_version = 0.6.0b3
files = setup.py hdf_compass/utils/__init__.py docs/conf.py HDFCompass.1file.spec

[bdist_wheel]
universal = 0
universal = 1

10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def txt_read(*paths):

setup_args['name'] = 'hdf_compass'
# The adopted versioning scheme follow PEP40
setup_args['version'] = '0.6.0b2'
setup_args['version'] = '0.6.0b3'
setup_args['url'] = 'https://github.com/HDFGroup/hdf-compass/'
setup_args['license'] = 'BSD-like license'
setup_args['author'] = 'HDFGroup'
Expand Down Expand Up @@ -97,17 +97,17 @@ def txt_read(*paths):
# requirements
setup_args['setup_requires'] =\
[
"setuptools",
"setuptools==19.2",
"wheel",
]
setup_args['install_requires'] =\
[
"numpy",
"matplotlib>=1.5",
"cartopy",
"cartopy[plotting]",
"h5py",
"wxPython",
"hydroffice.bag>=0.2.5",
"wxPython==3.0.2",
"hydroffice.bag>=0.2.10",
"pydap",
"requests"
]
Expand Down
11 changes: 6 additions & 5 deletions spec.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"title": "HDFCompass",
"background": "dmg.png",
"icon-size": 80,
"contents": [
{ "x": 128, "y": 110, "type": "file", "path": "dist/HDFCompass.app" },
"title": "HDFCompass 0.6.0b3",
"icon": "HDFCompass.icns",
"background": "dmg.png",
"icon-size": 80,
"contents": [
{ "x": 128, "y": 110, "type": "file", "path": "dist/HDFCompass.app" },
{ "x": 370, "y": 110, "type": "link", "path": "/Applications" }
]

Expand Down

0 comments on commit 47fba58

Please sign in to comment.