1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 pscript,
7 pytestCheckHook,
8 pythonAtLeast,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "vbuild";
14 version = "0.8.2";
15 pyproject = true;
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "manatlan";
21 repo = "vbuild";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-p9v1FiYn0cI+f/25hvjwm7eb1GqxXvNnmXBGwZe9fk0=";
24 };
25
26 postPatch = ''
27 # Switch to poetry-core, patch can't be applied, https://github.com/manatlan/vbuild/pull/12
28 substituteInPlace pyproject.toml \
29 --replace-fail 'version = "0.0.0"' 'version = "${version}"' \
30 --replace-fail 'requires = ["poetry>=0.12"]' 'requires = ["poetry-core>=1.0.0"]' \
31 --replace-fail 'build-backend = "poetry.masonry.api"' 'build-backend = "poetry.core.masonry.api"'
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [ pscript ];
37
38 nativeCheckInputs = [ pytestCheckHook ];
39
40 pythonImportsCheck = [ "vbuild" ];
41
42 disabledTests =
43 [
44 # Tests require network access
45 "test_min"
46 "test_pycomp_onlineClosurable"
47 ]
48 ++ lib.optionals (pythonAtLeast "3.13") [
49 "test_ok"
50 ];
51
52 disabledTestPaths = lib.optionals (pythonAtLeast "3.13") [
53 # https://github.com/manatlan/vbuild/issues/13
54 "tests/test_py2js.py"
55 "tests/test_PyStdLibIncludeOrNot.py"
56 "test_py_comp.py"
57 ];
58
59 meta = {
60 description = "Module to compile your VueJS components to standalone HTML/JS/CSS";
61 homepage = "https://github.com/manatlan/vbuild";
62 changelog = "https://github.com/manatlan/vbuild/blob/${src.rev}/changelog.md";
63 license = lib.licenses.mit;
64 maintainers = with lib.maintainers; [ fab ];
65 };
66}