summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/vbuild/default.nix
blob: 980f0ac52d574e92f8a7ce9b2db0c29d13f01b67 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  poetry-core,
  pscript,
  pytestCheckHook,
  pythonAtLeast,
}:

buildPythonPackage rec {
  pname = "vbuild";
  version = "0.8.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "manatlan";
    repo = "vbuild";
    tag = "v${version}";
    hash = "sha256-p9v1FiYn0cI+f/25hvjwm7eb1GqxXvNnmXBGwZe9fk0=";
  };

  postPatch = ''
    # Switch to poetry-core, patch can't be applied, https://github.com/manatlan/vbuild/pull/12
    substituteInPlace pyproject.toml \
      --replace-fail 'version = "0.0.0"' 'version = "${version}"' \
      --replace-fail 'requires = ["poetry>=0.12"]' 'requires = ["poetry-core>=1.0.0"]' \
      --replace-fail 'build-backend = "poetry.masonry.api"' 'build-backend = "poetry.core.masonry.api"'
  '';

  pythonRelaxDeps = [ "pscript" ];

  build-system = [ poetry-core ];

  dependencies = [ pscript ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "vbuild" ];

  disabledTests = [
    # Tests require network access
    "test_min"
    "test_pycomp_onlineClosurable"
  ]
  ++ lib.optionals (pythonAtLeast "3.13") [
    "test_ok"
  ];

  disabledTestPaths = lib.optionals (pythonAtLeast "3.13") [
    # https://github.com/manatlan/vbuild/issues/13
    "tests/test_py2js.py"
    "tests/test_PyStdLibIncludeOrNot.py"
    "test_py_comp.py"
  ];

  meta = {
    description = "Module to compile your VueJS components to standalone HTML/JS/CSS";
    homepage = "https://github.com/manatlan/vbuild";
    changelog = "https://github.com/manatlan/vbuild/blob/${src.rev}/changelog.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}