1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch2,
6 setuptools,
7 fissix,
8 pytest,
9}:
10
11let
12 version = "1.0.12";
13in
14
15buildPythonPackage {
16 pname = "nose2pytest";
17 inherit version;
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "pytest-dev";
22 repo = "nose2pytest";
23 rev = "v${version}";
24 hash = "sha256-BYyj2ZOZvWBpmzQACpmxAzCdQhlZlDYt+HLMdft+wYY=";
25 };
26
27 patches = [
28 # Drop Python 3.6 and 3.7 support
29 #
30 # Relaxes the runtime check for Python < 3.12.
31 (fetchpatch2 {
32 url = "https://github.com/pytest-dev/nose2pytest/commit/75ff506aaf11b5e20672441730657ee7540387e1.patch?full_index=1";
33 hash = "sha256-BpazrsB4b1oMBx9OemdVxhj/Jqbc8RKv2GC6gqkdGK8=";
34 })
35 ];
36
37 build-system = [ setuptools ];
38
39 dependencies = [
40 fissix
41 pytest
42 ];
43
44 # Tests depend on nose!
45 doCheck = false;
46
47 pythonImportsCheck = [ "nose2pytest.assert_tools" ];
48
49 meta = {
50 description = "Scripts to convert Python Nose tests to PyTest";
51 homepage = "https://github.com/pytest-dev/nose2pytest";
52 sourceProvenance = [ lib.sourceTypes.fromSource ];
53 license = lib.licenses.bsd3;
54 maintainers = [ lib.maintainers.emily ];
55 mainProgram = "nose2pytest";
56 };
57}