summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/nose2pytest/default.nix
blob: 72f554e8a50173720a6dfbbc2b3a1c7fa1b9e3d8 (plain)
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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch2,
  setuptools,
  fissix,
  pytest,
}:

let
  version = "1.0.12";
in

buildPythonPackage {
  pname = "nose2pytest";
  inherit version;
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pytest-dev";
    repo = "nose2pytest";
    rev = "v${version}";
    hash = "sha256-BYyj2ZOZvWBpmzQACpmxAzCdQhlZlDYt+HLMdft+wYY=";
  };

  patches = [
    # Drop Python 3.6 and 3.7 support
    #
    # Relaxes the runtime check for Python < 3.12.
    (fetchpatch2 {
      url = "https://github.com/pytest-dev/nose2pytest/commit/75ff506aaf11b5e20672441730657ee7540387e1.patch?full_index=1";
      hash = "sha256-BpazrsB4b1oMBx9OemdVxhj/Jqbc8RKv2GC6gqkdGK8=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [
    fissix
    pytest
  ];

  # Tests depend on nose!
  doCheck = false;

  pythonImportsCheck = [ "nose2pytest.assert_tools" ];

  meta = {
    description = "Scripts to convert Python Nose tests to PyTest";
    homepage = "https://github.com/pytest-dev/nose2pytest";
    sourceProvenance = [ lib.sourceTypes.fromSource ];
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.emily ];
    mainProgram = "nose2pytest";
  };
}