Unverified Commit bdaa7461 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

python3Packages.glymur: 0.13.6 -> 0.14.4 (#482331)

parents fa732285 d501e848
Loading
Loading
Loading
Loading
+26 −21
Original line number Diff line number Diff line
@@ -3,37 +3,39 @@
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  glibc,
  replaceVars,
  openjpeg,
  libtiff,
  glibc,

  # build-system
  setuptools,
  setuptools-scm,

  # dependencies
  lxml,
  numpy,
  openjpeg,
  pillow,

  # tests
  addBinToPathHook,
  pytestCheckHook,
  scikit-image,
  setuptools,
  replaceVars,
}:

buildPythonPackage (finalAttrs: {
  pname = "glymur";
  version = "0.13.6";
  version = "0.14.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "quintusdias";
    repo = "glymur";
    tag = "v${finalAttrs.version}";
    hash = "sha256-tIvDhlFPpDxC3CgBDT0RN9MM8ycY+J1hjcLXzx14Zhs=";
    hash = "sha256-9CvsknpvBIHe2HEqwN43RRhRxh8D0eHQ/T9W3/eVJlQ=";
  };

  patches = [
    # Numpy 2.x compatibility, https://github.com/quintusdias/glymur/pull/675
    (fetchpatch {
      name = "numpy2-compat.patch";
      url = "https://github.com/quintusdias/glymur/commit/89b159299035ebb05776c3b90278f410ca6dba64.patch";
      hash = "sha256-C/Q5WZmW5YtN3U8fxKljfqwKHtFLfR2LQ69Tj8SuIWg=";
    })
    (replaceVars ./set-lib-paths.patch {
      openjp2_lib = "${lib.getLib openjpeg}/lib/libopenjp2${stdenv.hostPlatform.extensions.sharedLibrary}";
      tiff_lib = "${lib.getLib libtiff}/lib/libtiff${stdenv.hostPlatform.extensions.sharedLibrary}";
@@ -41,28 +43,31 @@ buildPythonPackage (finalAttrs: {
  ];

  postPatch = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
    substituteInPlace glymur/lib/tiff.py \
        --replace-fail "glymur_config('c')" "ctypes.CDLL('${lib.getLib glibc}/lib/libc.so.6')"
    substituteInPlace glymur/lib/_tiff.py \
        --replace-fail \
          'glymur_config("c")' \
          'ctypes.CDLL("${lib.getLib glibc}/lib/libc.so.6")'
  '';

  __propagatedImpureHostDeps = lib.optional stdenv.hostPlatform.isDarwin "/usr/lib/libc.dylib";

  build-system = [ setuptools ];
  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    lxml
    numpy
    pillow
  ];

  nativeCheckInputs = [
    addBinToPathHook
    pytestCheckHook
    scikit-image
  ];

  preCheck = ''
    export PATH="$out/bin:$PATH"
  '';

  disabledTestPaths = [
    # this test involves glymur's different ways of finding the openjpeg path on
    # fsh systems by reading an .rc file and such, and is obviated by the patch
@@ -74,7 +79,7 @@ buildPythonPackage (finalAttrs: {
  meta = {
    description = "Tools for accessing JPEG2000 files";
    homepage = "https://github.com/quintusdias/glymur";
    changelog = "https://github.com/quintusdias/glymur/blob/${finalAttrs.src.rev}/CHANGES.txt";
    changelog = "https://github.com/quintusdias/glymur/blob/${finalAttrs.src.tag}/CHANGES.txt";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ tomasajt ];
  };
+9 −5
Original line number Diff line number Diff line
@@ -21,18 +21,22 @@
  tqdm,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
  pname = "parfive";
  version = "2.2.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Cadair";
    repo = "parfive";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-DIjS2q/SOrnLspomLHk8ZJ+krdzMyQfbIpXxad30s1k=";
  };

  pyproject = true;
  patches = [
    # SyntaxError: 'return' in a 'finally' block
    ./fix-python-3-14-compat.patch
  ];

  build-system = [ setuptools-scm ];

@@ -72,8 +76,8 @@ buildPythonPackage rec {
    description = "HTTP and FTP parallel file downloader";
    mainProgram = "parfive";
    homepage = "https://parfive.readthedocs.io/";
    changelog = "https://github.com/Cadair/parfive/releases/tag/${src.tag}";
    changelog = "https://github.com/Cadair/parfive/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.sarahec ];
  };
}
})
+14 −0
Original line number Diff line number Diff line
diff --git a/parfive/downloader.py b/parfive/downloader.py
index 7a4116b..370ea78 100644
--- a/parfive/downloader.py
+++ b/parfive/downloader.py
@@ -317,8 +317,7 @@ class Downloader:
                     task.cancel()
                 dl_results = await asyncio.gather(*tasks, return_exceptions=True)
 
-            finally:
-                return self._format_results(dl_results, main_pb)
+            return self._format_results(dl_results, main_pb)
 
     def _format_results(self, retvals, main_pb):
         # Squash all nested lists into a single flat list
+72 −61
Original line number Diff line number Diff line
{
  lib,
  asdf,
  asdf-astropy,
  astropy,
  beautifulsoup4,
  buildPythonPackage,
  contourpy,
  dask,
  drms,
  extension-helpers,
  fetchFromGitHub,

  # build-system
  extension-helpers,
  numpy,
  setuptools,
  setuptools-scm,

  # dependencies
  astropy,
  fsspec,
  packaging,
  parfive,
  pyerfa,
  requests,

  # optional-dependencies
  # asdf
  asdf,
  asdf-astropy,
  # dask
  dask,
  # image
  scipy,
  # jpeg
  glymur,
  h5netcdf,
  h5py,
  hypothesis,
  lxml,
  # jupyter
  itables,
  ipywidgets,
  # map
  contourpy,
  matplotlib,
  numpy,
  reproject,
  # net
  beautifulsoup4,
  drms,
  python-dateutil,
  tqdm,
  zeep,
  # opencv
  opencv-python,
  packaging,
  # scikit-image
  scikit-image,
  # timeseries
  h5netcdf,
  h5py,
  pandas,
  parfive,
  pyerfa,

  # tests
  hypothesis,
  pytest-astropy,
  pytestCheckHook,
  pytest-mock,
  python-dateutil,
  pythonOlder,
  reproject,
  requests,
  scikit-image,
  scipy,
  setuptools,
  setuptools-scm,
  tqdm,
  pytestCheckHook,
  writableTmpDirAsHomeHook,
  zeep,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
  pname = "sunpy";
  version = "7.0.2";
  version = "7.1.0";
  pyproject = true;

  disabled = pythonOlder "3.11";

  src = fetchFromGitHub {
    owner = "sunpy";
    repo = "sunpy";
    tag = "v${version}";
    hash = "sha256-1LT6Dr9OZYIZkOICSYD8lt5v3Gn1gZGN4GWeJL6IH5w=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-FeKmg3dZfbbjt1lDliF4uXf8PvM3J5HWtYqKRriJ4l0=";
  };

  # As of 2025-10-15, this requires numpy >=1.25.0,<2.3.
  # (The >=1.25.0 constraint is in dependencies, the <2.3 in build-system)
  # We can't use 1.x because it's not supported on Python 3.13+.
  # And since numpy 2.x is at 2.3.2, it's not supported.
  # However, the upper bound is "for matching the numpy deprecation policy",
  # so relaxing it should be OK. (It silently was overridden previously,
  # due to the use of `format = "setuptools"` instead of `pyproject = true`)
  postPatch = ''
    substituteInPlace pyproject.toml --replace-fail "numpy>=2.0.0rc1,<2.3" "numpy"
  '';

  build-system = [
    extension-helpers
    numpy
    setuptools
    setuptools-scm # Technically needs setuptools-scm[toml], but that's our default.
    numpy
  ];

  dependencies = [
@@ -82,7 +88,7 @@ buildPythonPackage rec {
  ]
  ++ parfive.optional-dependencies.ftp;

  optional-dependencies = {
  optional-dependencies = lib.fix (self: {
    asdf = [
      asdf
      asdf-astropy
@@ -93,6 +99,10 @@ buildPythonPackage rec {
      glymur
      lxml
    ];
    jupyter = [
      itables
      ipywidgets
    ];
    map = [
      contourpy
      matplotlib
@@ -125,30 +135,30 @@ buildPythonPackage rec {
    # We can't use `with` here because "map" would still be the builtin, and
    # we can't below because scikit-image would still be this package's argument.
    core = lib.concatLists [
      optional-dependencies.image
      optional-dependencies.map
      optional-dependencies.net
      optional-dependencies.timeseries
      optional-dependencies.visualization
      self.image
      self.map
      self.net
      self.timeseries
      self.visualization
    ];
    all = lib.concatLists [
      optional-dependencies.core
      optional-dependencies.asdf
      optional-dependencies.jpeg2000
      optional-dependencies.opencv
      self.core
      self.asdf
      self.jpeg2000
      self.opencv
      # optional-dependencies.spice
      optional-dependencies.scikit-image
      self.scikit-image
    ];
  };
  });

  nativeCheckInputs = [
    hypothesis
    pytest-astropy
    pytestCheckHook
    pytest-mock
    pytestCheckHook
    writableTmpDirAsHomeHook
  ]
  ++ optional-dependencies.all;
  ++ finalAttrs.passthru.optional-dependencies.all;

  disabledTests = [
    "rst" # Docs
@@ -156,6 +166,7 @@ buildPythonPackage rec {
    "test_find_dependencies" # Needs cdflib
    # Needs mpl-animators
    "sunpy.coordinates.utils.GreatArc"
    "test_cutout_not_on_disk_when_tracking"
    "test_expand_list_generator_map"
    "test_great_arc_different_observer"
    "test_great_arc_points_differentiates"
@@ -196,14 +207,14 @@ buildPythonPackage rec {
    "sunpy/coordinates/tests/test_spice.py"
  ];

  pytestFlags = [ "-Wignore::DeprecationWarning" ];

  pythonImportsCheck = [ "sunpy" ];

  meta = {
    description = "Python for Solar Physics";
    homepage = "https://sunpy.org";
    downloadPage = "github.com/sunpy/sunpy";
    changelog = "https://docs.sunpy.org/en/stable/whatsnew/changelog.html";
    license = lib.licenses.bsd2;
    maintainers = [ ];
  };
}
})