2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, protobuf
|
|
|
|
, dill
|
|
|
|
, grpcio
|
2022-11-21 17:40:18 +00:00
|
|
|
, pulumi
|
2022-06-16 17:23:12 +00:00
|
|
|
, isPy27
|
|
|
|
, semver
|
2022-11-21 17:40:18 +00:00
|
|
|
, pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
, pyyaml
|
|
|
|
, six
|
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
2022-11-21 17:40:18 +00:00
|
|
|
inherit (pulumi) version src;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "pulumi";
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
disabled = isPy27;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
semver
|
|
|
|
protobuf
|
|
|
|
dill
|
|
|
|
grpcio
|
|
|
|
pyyaml
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-21 17:40:18 +00:00
|
|
|
pulumi.pkgs.pulumi-language-python
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"test/"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
sourceRoot = "${src.name}/sdk/python/lib";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# we apply the modifications done in the pulumi/sdk/python/Makefile
|
|
|
|
# but without the venv code
|
|
|
|
postPatch = ''
|
|
|
|
cp ../../README.md .
|
2022-11-21 17:40:18 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "3.0.0" "${version}" \
|
2023-05-24 13:37:59 +00:00
|
|
|
--replace "grpcio==1.51.3" "grpcio" \
|
|
|
|
--replace "semver~=2.13" "semver"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# Allow local networking in tests on Darwin
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
# Verify that the version substitution works
|
|
|
|
preCheck = ''
|
|
|
|
pip show "${pname}" | grep "Version: ${version}" > /dev/null \
|
|
|
|
|| (echo "ERROR: Version substitution seems to be broken"; exit 1)
|
|
|
|
'';
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
pythonImportsCheck = [ "pulumi" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Modern Infrastructure as Code. Any cloud, any language";
|
|
|
|
homepage = "https://github.com/pulumi/pulumi";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
};
|
|
|
|
}
|