Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / draftjs-exporter / default.nix
blobdd03080277b5344da83f7fed65c0d6b04adf743d
1 { beautifulsoup4
2 , buildPythonPackage
3 , fetchFromGitHub
4 , html5lib
5 , lib
6 , lxml
7 , python
8 }:
10 buildPythonPackage rec {
11   pname = "draftjs-exporter";
12   version = "5.0.0";
13   format = "setuptools";
15   src = fetchFromGitHub {
16     repo = "draftjs_exporter";
17     owner = "springload";
18     rev = "refs/tags/v${version}";
19     sha256 = "sha256-4MmCVRx350p6N9XqTZSo8ROI/OJ0s4aKSYH9+Oxgvf4=";
20   };
22   passthru.optional-dependencies = {
23     lxml = [ lxml ];
24     html5lib = [ beautifulsoup4 html5lib ];
25   };
27   checkInputs = passthru.optional-dependencies.lxml ++ passthru.optional-dependencies.html5lib;
29   checkPhase = ''
30     # 2 tests in this file randomly fail because they depend on the order of
31     # HTML attributes
32     rm tests/test_exports.py
34     ${python.interpreter} -m unittest discover
35   '';
37   pythonImportsCheck = [ "draftjs_exporter" ];
39   meta = with lib; {
40     description = "Library to convert Draft.js ContentState to HTML";
41     homepage = "https://github.com/springload/draftjs_exporter";
42     changelog = "https://github.com/springload/draftjs_exporter/blob/v${version}/CHANGELOG.md";
43     license = licenses.mit;
44     maintainers = with maintainers; [ sephi ];
45   };