1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 buildPythonPackage,
6 setuptools,
7 mutf8,
8 webassets,
9 pytestCheckHook,
10 mock,
11}:
12
13buildPythonPackage rec {
14 pname = "dukpy";
15 version = "0.5.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "amol-";
20 repo = "dukpy";
21 tag = version;
22 hash = "sha256-5+SdGHYBron6EwpCf5ByaK8KuqQXhvN73wQUptvgPzc=";
23 };
24
25 postPatch = ''
26 substituteInPlace tests/test_webassets_filter.py \
27 --replace-fail "class PyTestTemp" "class _Temp" \
28 --replace-fail "PyTestTemp" "Temp"
29 '';
30
31 build-system = [ setuptools ];
32
33 dependencies = [ mutf8 ];
34
35 optional-dependencies = {
36 webassets = [ webassets ];
37 };
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 mock
42 ]
43 ++ optional-dependencies.webassets;
44
45 disabledTests = [ "test_installer" ];
46
47 preCheck = ''
48 rm -r dukpy
49 '';
50
51 pythonImportsCheck = [ "dukpy" ];
52
53 meta = {
54 description = "Simple JavaScript interpreter for Python";
55 homepage = "https://github.com/amol-/dukpy";
56 changelog = "https://github.com/amol-/dukpy/releases/tag/${src.tag}";
57 license = lib.licenses.mit;
58 maintainers = with lib.maintainers; [ ruby0b ];
59 mainProgram = "dukpy";
60 # error: 'TARGET_OS_BRIDGE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
61 # https://github.com/amol-/dukpy/issues/82
62 broken = stdenv.cc.isClang;
63 };
64}