1{
2 lib,
3 buildPythonPackage,
4 protobuf,
5 dill,
6 grpcio,
7 pulumi,
8 isPy27,
9 semver,
10 pip,
11 pytestCheckHook,
12 pyyaml,
13 six,
14}:
15buildPythonPackage rec {
16 inherit (pulumi) version src;
17
18 pname = "pulumi";
19 format = "setuptools";
20
21 disabled = isPy27;
22
23 propagatedBuildInputs = [
24 semver
25 protobuf
26 dill
27 grpcio
28 pyyaml
29 six
30 ];
31
32 nativeCheckInputs = [
33 pip
34 pulumi.pkgs.pulumi-language-python
35 pytestCheckHook
36 ];
37
38 pytestFlagsArray = [ "test/" ];
39
40 sourceRoot = "${src.name}/sdk/python/lib";
41
42 # we apply the modifications done in the pulumi/sdk/python/Makefile
43 # but without the venv code
44 postPatch = ''
45 cp ../../README.md .
46 substituteInPlace setup.py \
47 --replace "3.0.0" "${version}" \
48 --replace "grpcio==1.56.2" "grpcio" \
49 --replace "semver~=2.13" "semver"
50 '';
51
52 # Allow local networking in tests on Darwin
53 __darwinAllowLocalNetworking = true;
54
55 # Verify that the version substitution works
56 preCheck = ''
57 pip show "${pname}" | grep "Version: ${version}" > /dev/null \
58 || (echo "ERROR: Version substitution seems to be broken"; exit 1)
59 '';
60
61 pythonImportsCheck = [ "pulumi" ];
62
63 meta = with lib; {
64 description = "Modern Infrastructure as Code. Any cloud, any language";
65 homepage = "https://github.com/pulumi/pulumi";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ teto ];
68 };
69}