summary refs log tree commit diff
path: root/pkgs/development/python-modules/prance/default.nix
blob: 26cfada4296e529dbd2c211161006ee68bcceca5 (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
61
62
63
64
65
{ lib
, buildPythonPackage
, fetchFromGitHub
, chardet
, requests
, ruamel-yaml
, setuptools-scm
, six
, semver
, pytestCheckHook
, openapi-spec-validator
}:

buildPythonPackage rec {
  pname = "prance";
  version = "0.21.8.0";

  src = fetchFromGitHub {
    owner = "RonnyPfannschmidt";
    repo = pname;
    rev = "v${version}";
    fetchSubmodules = true;
    sha256 = "sha256-kGANMHfWwhW3ZBw2ZVCJZR/bV2EPhcydMKhDeDTVwcQ=";
  };

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeBuildInputs = [
    setuptools-scm
  ];

  propagatedBuildInputs = [
    chardet
    requests
    ruamel-yaml
    six
    semver
  ];

  checkInputs = [
    pytestCheckHook
    openapi-spec-validator
  ];

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "--cov=prance --cov-report=term-missing --cov-fail-under=90" ""
  '';

  # Disable tests that require network
  disabledTestPaths = [
    "tests/test_convert.py"
  ];
  disabledTests = [
    "test_fetch_url_http"
  ];
  pythonImportsCheck = [ "prance" ];

  meta = with lib; {
    description = "Resolving Swagger/OpenAPI 2.0 and 3.0.0 Parser";
    homepage = "https://github.com/RonnyPfannschmidt/prance";
    license = licenses.mit;
    maintainers = [ maintainers.costrouc ];
  };
}