1{
2 lib,
3 pkgs,
4 pulumiPackages,
5 buildPythonPackage,
6 pythonOlder,
7 hatchling,
8 protobuf,
9 grpcio,
10 dill,
11 six,
12 semver,
13 pyyaml,
14 debugpy,
15 pip,
16 pytest,
17 pytest-asyncio,
18 pytest-timeout,
19 python,
20}:
21let
22 inherit (pkgs.pulumi) pname version src;
23 inherit (pulumiPackages) pulumi-python;
24 sourceRoot = "${src.name}/sdk/python";
25in
26buildPythonPackage {
27 inherit
28 pname
29 version
30 src
31 sourceRoot
32 ;
33
34 outputs = [
35 "out"
36 "dev"
37 ];
38
39 pyproject = true;
40
41 disabled = pythonOlder "3.9";
42
43 build-system = [ hatchling ];
44
45 dependencies = [
46 protobuf
47 grpcio
48 dill
49 six
50 semver
51 pyyaml
52 debugpy
53 pip
54 ];
55
56 pythonRelaxDeps = [
57 "protobuf"
58 "grpcio"
59 "pip"
60 "semver"
61 ];
62
63 nativeCheckInputs = [
64 pytest
65 pytest-asyncio
66 pytest-timeout
67 pulumi-python
68 ];
69
70 disabledTestPaths = [
71 # TODO: remove disabledTestPaths once the test is fixed upstream.
72 # https://github.com/pulumi/pulumi/pull/19080#discussion_r2309611222
73 "lib/test/provider/experimental/test_property_value.py::test_nesting"
74 ];
75
76 # https://github.com/pulumi/pulumi/blob/0acaf8060640fdd892abccf1ce7435cd6aae69fe/sdk/python/scripts/test_fast.sh#L10-L11
77 # https://github.com/pulumi/pulumi/blob/0acaf8060640fdd892abccf1ce7435cd6aae69fe/sdk/python/scripts/test_fast.sh#L16
78 installCheckPhase = ''
79 runHook preInstallCheck
80 declare -a _disabledTestPathsArray
81 concatTo _disabledTestPathsArray disabledTestPaths
82 ${python.executable} -m pytest --junit-xml= --ignore=lib/test/automation lib/test \
83 "''${_disabledTestPathsArray[@]/#/--deselect=}"
84 pushd lib/test_with_mocks
85 ${python.executable} -m pytest --junit-xml=
86 popd
87 runHook postInstallCheck
88 '';
89
90 # Allow local networking in tests on Darwin
91 __darwinAllowLocalNetworking = true;
92
93 pythonImportsCheck = [ "pulumi" ];
94
95 meta = {
96 description = "Modern Infrastructure as Code. Any cloud, any language";
97 homepage = "https://www.pulumi.com";
98 license = lib.licenses.asl20;
99 maintainers = with lib.maintainers; [
100 teto
101 tie
102 ];
103 };
104}