about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pywavelets/default.nix
blob: af598a1439cafabe1cfa65537d9c9a5a4975136d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, meson-python
, cython
, pytestCheckHook
, numpy
}:

buildPythonPackage rec {
  pname = "pywavelets";
  version = "1.6.0";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "PyWavelets";
    repo = "pywt";
    rev = "refs/tags/v${version}";
    hash = "sha256-Dr6LWGVlYGDD21l1RQ7elScovcen5uuFdJJXe3deB5o=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail '"numpy>=2.0.0rc1,<2.3",' ""
  '';

  build-system = [
    meson-python
    cython
    numpy
  ];

  dependencies = [ numpy ];

  nativeCheckInputs = [ pytestCheckHook ];

  preCheck = ''
    cd $out
  '';

  # ensure compiled modules are present
  pythonImportsCheck = [
    "pywt"
    "pywt._extensions._cwt"
    "pywt._extensions._dwt"
    "pywt._extensions._pywt"
    "pywt._extensions._swt"
  ];

  meta = with lib; {
    description = "Wavelet transform module";
    homepage = "https://github.com/PyWavelets/pywt";
    changelog = "https://github.com/PyWavelets/pywt/releases/tag/v${version}";
    license = licenses.mit;
  };

}