summary refs log tree commit diff
path: root/pkgs/development/python-modules/xmlschema/default.nix
blob: 788ccc0ed81b791a41e8e075c7559fc60c304470 (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
{ lib, buildPythonPackage, fetchFromGitHub
, elementpath
, pytest
}:

buildPythonPackage rec {
  version = "1.0.18";
  pname = "xmlschema";

  src = fetchFromGitHub {
    owner = "sissaschool";
    repo = "xmlschema";
    rev = "v${version}";
    sha256 = "1pwq2sfh7klcxismsqzgw80cp3cdkq9wv8x9g3h1zx1p66xpas9p";
  };

  propagatedBuildInputs = [ elementpath ];

  checkInputs = [ pytest ];

  # Ignore broken fixtures, and tests for files which don't exist.
  # For darwin, we need to explicity say we can't reach network
  checkPhase = ''
    substituteInPlace xmlschema/tests/__init__.py \
      --replace "SKIP_REMOTE_TESTS = " "SKIP_REMOTE_TESTS = True #"
    pytest . \
      --ignore=xmlschema/tests/test_factory.py \
      --ignore=xmlschema/tests/test_memory.py \
      --ignore=xmlschema/tests/test_validators.py \
      --ignore=xmlschema/tests/test_schemas.py \
      -k 'not element_tree_import_script'
  '';

  meta = with lib; {
    description = "XML Schema validator and data conversion library for Python";
    homepage = "https://github.com/sissaschool/xmlschema";
    license = licenses.mit;
    maintainers = with maintainers; [ jonringer ];
  };
}