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
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2022-11-21 17:40:18 +00:00
|
|
|
pulumi.pkgs.pulumi-language-python
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"test/"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
sourceRoot = "source/sdk/python/lib";
|
|
|
|
|
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}" \
|
|
|
|
--replace "grpcio==1.47" "grpcio"
|
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 ];
|
|
|
|
};
|
|
|
|
}
|