about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest-spec/default.nix
blob: 2a90d45a6ea1a84cf8f0be99d640d8ed86f9f9dd (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  poetry-core,
  pytest,
  pytestCheckHook,
  pytest-describe,
}:

buildPythonPackage {
  pname = "pytest-spec";
  version = "3.2.0-unstable-2023-06-04";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pchomik";
    repo = "pytest-spec";
    rev = "e16e0550dd6bc557411e4312b7b42d53b26e69ef";
    hash = "sha256-dyDUdZJU4E4y1yCzunAX2c48Qv6ogu0b60U/5YbJvIU=";
  };

  postPatch = ''
    sed -i '/addopts/d' setup.cfg
    # TODO: upstream
    substituteInPlace pyproject.toml \
        --replace-fail "poetry>=0.12" "poetry-core" \
        --replace-fail "poetry.masonry.api" "poetry.core.masonry.api"
  '';

  nativeBuildInputs = [ poetry-core ];

  buildInputs = [ pytest ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-describe
  ];

  pytestFlagsArray = [ "--spec" ];

  pythonImportsCheck = [ "pytest_spec" ];

  meta = {
    description = "A pytest plugin to display test execution output like a SPECIFICATION";
    homepage = "https://github.com/pchomik/pytest-spec";
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [ tomasajt ];
  };
}