blob: 35315a9623ae2691b776c8a3c935a01865676153 (
plain)
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
|
{
beautifulsoup4,
buildPythonPackage,
fetchFromGitHub,
html5lib,
lib,
lxml,
python,
}:
buildPythonPackage rec {
pname = "draftjs-exporter";
version = "5.1.0";
format = "setuptools";
src = fetchFromGitHub {
repo = "draftjs_exporter";
owner = "springload";
tag = "v${version}";
sha256 = "sha256-AR8CK75UdtEThE68WSE6DFSqryI509GTW1fBl1SL29w=";
};
optional-dependencies = {
lxml = [ lxml ];
html5lib = [
beautifulsoup4
html5lib
];
};
checkInputs = optional-dependencies.lxml ++ optional-dependencies.html5lib;
checkPhase = ''
# 2 tests in this file randomly fail because they depend on the order of
# HTML attributes
rm tests/test_exports.py
${python.interpreter} -m unittest discover
'';
pythonImportsCheck = [ "draftjs_exporter" ];
meta = {
description = "Library to convert Draft.js ContentState to HTML";
homepage = "https://github.com/springload/draftjs_exporter";
changelog = "https://github.com/springload/draftjs_exporter/blob/${src.tag}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ sephi ];
};
}
|