1{ lib, buildPythonPackage, fetchFromGitHub
2, elementpath
3, lxml
4, pytest
5}:
6
7buildPythonPackage rec {
8 version = "1.2.3";
9 pname = "xmlschema";
10
11 src = fetchFromGitHub {
12 owner = "sissaschool";
13 repo = "xmlschema";
14 rev = "v${version}";
15 sha256 = "1lasi84d5v66xpd40fbj3lqwc5hfh3izxrr2wbfdbj4a3m996zc9";
16 };
17
18 propagatedBuildInputs = [ elementpath ];
19
20 checkInputs = [ lxml pytest ];
21
22 postPatch = ''
23 substituteInPlace setup.py \
24 --replace "elementpath~=2.0.0" "elementpath~=2.0"
25 '';
26
27 # Ignore broken fixtures, and tests for files which don't exist.
28 # For darwin, we need to explicity say we can't reach network
29 checkPhase = ''
30 pytest tests \
31 --ignore=tests/test_factory.py \
32 --ignore=tests/test_schemas.py \
33 --ignore=tests/test_memory.py \
34 --ignore=tests/test_validation.py \
35 -k 'not element_tree_import_script'
36 '';
37
38 meta = with lib; {
39 description = "XML Schema validator and data conversion library for Python";
40 homepage = "https://github.com/sissaschool/xmlschema";
41 license = licenses.mit;
42 maintainers = with maintainers; [ jonringer ];
43 };
44}