ncv 0.3.2__tar.gz → 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {ncv-0.3.2 → ncv-0.3.3}/PKG-INFO +1 -1
  2. {ncv-0.3.2 → ncv-0.3.3}/ncv/app.py +3 -2
  3. {ncv-0.3.2 → ncv-0.3.3}/ncv/qt_compat.py +8 -0
  4. {ncv-0.3.2 → ncv-0.3.3}/ncv.egg-info/PKG-INFO +1 -1
  5. {ncv-0.3.2 → ncv-0.3.3}/pyproject.toml +1 -1
  6. {ncv-0.3.2 → ncv-0.3.3}/tests/test_session_qt.py +27 -0
  7. {ncv-0.3.2 → ncv-0.3.3}/LICENSE +0 -0
  8. {ncv-0.3.2 → ncv-0.3.3}/README.md +0 -0
  9. {ncv-0.3.2 → ncv-0.3.3}/ncv/__init__.py +0 -0
  10. {ncv-0.3.2 → ncv-0.3.3}/ncv/__main__.py +0 -0
  11. {ncv-0.3.2 → ncv-0.3.3}/ncv/dimensions.py +0 -0
  12. {ncv-0.3.2 → ncv-0.3.3}/ncv/images/ncvue_icon.ico +0 -0
  13. {ncv-0.3.2 → ncv-0.3.3}/ncv/images/ncvue_icon.png +0 -0
  14. {ncv-0.3.2 → ncv-0.3.3}/ncv/ncvcommon.py +0 -0
  15. {ncv-0.3.2 → ncv-0.3.3}/ncv/ncvcontour.py +0 -0
  16. {ncv-0.3.2 → ncv-0.3.3}/ncv/ncvmap.py +0 -0
  17. {ncv-0.3.2 → ncv-0.3.3}/ncv/ncvmatrix.py +0 -0
  18. {ncv-0.3.2 → ncv-0.3.3}/ncv/ncvmethods.py +0 -0
  19. {ncv-0.3.2 → ncv-0.3.3}/ncv/ncvscatter.py +0 -0
  20. {ncv-0.3.2 → ncv-0.3.3}/ncv/ncvutils.py +0 -0
  21. {ncv-0.3.2 → ncv-0.3.3}/ncv/session.py +0 -0
  22. {ncv-0.3.2 → ncv-0.3.3}/ncv/ui/contour_panel.ui +0 -0
  23. {ncv-0.3.2 → ncv-0.3.3}/ncv/ui/main_window.ui +0 -0
  24. {ncv-0.3.2 → ncv-0.3.3}/ncv/ui/map_panel.ui +0 -0
  25. {ncv-0.3.2 → ncv-0.3.3}/ncv/ui/map_unavailable.ui +0 -0
  26. {ncv-0.3.2 → ncv-0.3.3}/ncv/ui/matrix_panel.ui +0 -0
  27. {ncv-0.3.2 → ncv-0.3.3}/ncv/ui/scatter_panel.ui +0 -0
  28. {ncv-0.3.2 → ncv-0.3.3}/ncv.egg-info/SOURCES.txt +0 -0
  29. {ncv-0.3.2 → ncv-0.3.3}/ncv.egg-info/dependency_links.txt +0 -0
  30. {ncv-0.3.2 → ncv-0.3.3}/ncv.egg-info/entry_points.txt +0 -0
  31. {ncv-0.3.2 → ncv-0.3.3}/ncv.egg-info/requires.txt +0 -0
  32. {ncv-0.3.2 → ncv-0.3.3}/ncv.egg-info/top_level.txt +0 -0
  33. {ncv-0.3.2 → ncv-0.3.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ncv
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: A quick PyQt6 viewer for NetCDF files
5
5
  Author-email: Sanjeev Bashyal <sanjeev.bashyal@ufz.de>
6
6
  License: MIT
@@ -5,6 +5,9 @@ import sys
5
5
 
6
6
  import numpy as np
7
7
 
8
+ from .qt_compat import QtGui, QtWidgets, require_qt
9
+ require_qt()
10
+
8
11
  from . import ncvmap as _ncvmap
9
12
  from .ncvcommon import load_ui, resource_path
10
13
  from .ncvcontour import ContourPanel
@@ -12,7 +15,6 @@ from .ncvmap import MapPanel, MapUnavailablePanel
12
15
  from .ncvmatrix import MatrixPanel
13
16
  from .ncvscatter import ScatterPanel
14
17
  from .ncvutils import selvar, vardim2var
15
- from .qt_compat import QtGui, QtWidgets, require_qt
16
18
  from .session import HAVE_XARRAY, NcvSession, normalize_files
17
19
 
18
20
 
@@ -181,7 +183,6 @@ class NcvMainWindow(QtWidgets.QMainWindow):
181
183
 
182
184
  def ncv(ncfile=None, miss=None, usex=False):
183
185
  """Launch the Qt ncv application."""
184
- require_qt()
185
186
  if miss is None:
186
187
  miss = np.nan
187
188
  app = QtWidgets.QApplication.instance()
@@ -35,4 +35,12 @@ def require_qt() -> None:
35
35
  " conda install -c conda-forge freetype harfbuzz",
36
36
  " conda install -c conda-forge pyqt # or take Qt from conda",
37
37
  ]
38
+ elif "cannot open shared object file" in str(QT_IMPORT_ERROR):
39
+ message += [
40
+ "",
41
+ "A system library Qt needs is missing on this machine (commonly on",
42
+ "HPC nodes). Install Qt with its own libraries from conda-forge:",
43
+ " conda install -c conda-forge pyqt",
44
+ "or ask the administrators for the library named above.",
45
+ ]
38
46
  raise RuntimeError("\n".join(message)) from QT_IMPORT_ERROR
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ncv
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: A quick PyQt6 viewer for NetCDF files
5
5
  Author-email: Sanjeev Bashyal <sanjeev.bashyal@ufz.de>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ncv"
7
- version = "0.3.2"
7
+ version = "0.3.3"
8
8
  description = "A quick PyQt6 viewer for NetCDF files"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1242,6 +1242,33 @@ def test_metadata_toggle_restores_width(qt_app):
1242
1242
  qt_app.processEvents()
1243
1243
  assert panel._header_splitter.sizes() == chosen
1244
1244
 
1245
+ def test_broken_pyqt6_reports_the_real_reason():
1246
+ # what an HPC node without Qt's system libraries does: PyQt6 won't load
1247
+ code = """
1248
+ import builtins, sys
1249
+ real_import = builtins.__import__
1250
+ def blocked(name, *args, **kwargs):
1251
+ if name.startswith("PyQt6"):
1252
+ raise ImportError("libEGL.so.1: cannot open shared object file")
1253
+ return real_import(name, *args, **kwargs)
1254
+ builtins.__import__ = blocked
1255
+ import ncv # the package itself stays importable
1256
+ try:
1257
+ import ncv.app
1258
+ except RuntimeError as exc:
1259
+ print("RUNTIME:", exc)
1260
+ except Exception as exc:
1261
+ print("OTHER:", type(exc).__name__, exc)
1262
+ """
1263
+ result = subprocess.run([sys.executable, "-c", code], capture_output=True,
1264
+ text=True, cwd=Path(__file__).parents[1])
1265
+ out = result.stdout
1266
+ assert "RUNTIME: ncv requires PyQt6" in out, out + result.stderr
1267
+ assert "libEGL.so.1" in out # the real reason
1268
+ assert "conda install -c conda-forge pyqt" in out
1269
+ assert "NoneType" not in out
1270
+
1271
+
1245
1272
  def test_cli_help_uses_ncv_entrypoint():
1246
1273
  result = subprocess.run(
1247
1274
  [sys.executable, "-m", "ncv", "--help"],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes