python310Packages.pulumi: use pulumi instead of pulumi-bin

This commit is contained in:
Vincent Haupert 2022-10-17 19:29:31 +02:00
parent 08328db2a4
commit 9d67386657
2 changed files with 27 additions and 40 deletions

View File

@ -1,42 +1,22 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchFromGitHub
, protobuf
, dill
, grpcio
, pulumi-bin
, pulumi
, isPy27
, semver
, pytestCheckHook
, pyyaml
, six
# for tests
, go
, pulumictl
, pylint
, pytest
, pytest-timeout
, wheel
, pytest-asyncio
, mypy
}:
let
data = import ./data.nix {};
in
buildPythonPackage rec {
pname = "pulumi";
version = pulumi-bin.version;
disabled = isPy27;
inherit (pulumi) version src;
src = fetchFromGitHub {
owner = "pulumi";
repo = "pulumi";
rev = "v${pulumi-bin.version}";
sha256 = "sha256-vqEZEHTpJV65a3leWwYhyi3dzAsN67BXOvk5hnTPeuI=";
};
pname = "pulumi";
disabled = isPy27;
propagatedBuildInputs = [
semver
@ -48,26 +28,33 @@ buildPythonPackage rec {
];
checkInputs = [
pulumi-bin
pulumictl
mypy
go
pytest
pytest-timeout
pytest-asyncio
wheel
pulumi.pkgs.pulumi-language-python
pytestCheckHook
];
pytestFlagsArray = [
"test/"
];
sourceRoot = "source/sdk/python/lib";
# we apply the modifications done in the pulumi/sdk/python/Makefile
# but without the venv code
postPatch = ''
cp ../../README.md .
sed -i "s/\''${VERSION}/${version}/g" setup.py
substituteInPlace setup.py \
--replace "3.0.0" "${version}" \
--replace "grpcio==1.47" "grpcio"
'';
# disabled because tests try to fetch go packages from the net
doCheck = false;
# 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)
'';
pythonImportsCheck = [ "pulumi" ];

View File

@ -1070,7 +1070,7 @@ self: super: with self; {
pad4pi = callPackage ../development/python-modules/pad4pi { };
pulumi = callPackage ../development/python-modules/pulumi { };
pulumi = callPackage ../development/python-modules/pulumi { inherit (pkgs) pulumi; };
pulumi-aws = callPackage ../development/python-modules/pulumi-aws { };