From b4c69d74eb4bde1def09f7e4da314b864962ed53 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 6 Mar 2022 22:04:47 +0100 Subject: [PATCH 1/3] python3Packages.pulumi: init at 3.25.1 --- .../python-modules/pulumi/default.nix | 102 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 104 insertions(+) create mode 100644 pkgs/development/python-modules/pulumi/default.nix diff --git a/pkgs/development/python-modules/pulumi/default.nix b/pkgs/development/python-modules/pulumi/default.nix new file mode 100644 index 00000000000..3f1d5205f2c --- /dev/null +++ b/pkgs/development/python-modules/pulumi/default.nix @@ -0,0 +1,102 @@ +{ lib +, buildPythonPackage +, fetchpatch +, fetchFromGitHub +, protobuf +, dill +, grpcio +, pulumi-bin +, isPy27 +, semver +, pyyaml +, six + +# for tests +, tox +, go +, pulumictl +, bash +, pylint +, pytest +, pytest-timeout +, coverage +, black +, wheel +, pytest-asyncio + +, mypy +}: + +buildPythonPackage rec { + pname = "pulumi"; + version = pulumi.version; + disabled = isPy27; + + src = pulumi.src; + + patches = [ + # remove in next release + (fetchpatch { + url = "https://github.com/pulumi/pulumi/commit/d4b9d61d70972d22a344419fafc30aace58607f5.patch"; + sha256 = "HEF7VWunFO+NCG18fZA7lbE2l8pc6Z3jcD+rSZ1Jsqg="; + }) ]; + + # src = fetchFromGitHub { + # owner = "pulumi"; + # repo = "pulumi"; + # rev = "073e94a0b8b4ef0b1b856c63670a8dd88f6b6d02"; + # sha256 = "sha256-oyjQW/Z1NvsHpUwikX+bl1npfF4LESOua/o1qjqAgUs="; + # }; + + propagatedBuildInputs = [ + semver + protobuf + dill + grpcio + pyyaml + six + ]; + + checkInputs = [ + pulumi-bin + pulumictl + mypy + bash + go + tox + # pylint + pytest + pytest-timeout + coverage + pytest-asyncio + wheel + black + ]; + + pythonImportsCheck = ["pulumi"]; + + postPatch = '' + cp README.md sdk/python/lib + patchShebangs . + cd sdk/python/lib + substituteInPlace ../Makefile \ + --replace '$(shell cd ../../ && pulumictl get version)' '${pulumi-bin.version}' \ + --replace '$(shell cd ../../ && pulumictl get version --language python)' '${version}' + + substituteInPlace ../requirements.txt \ + --replace 'pylint==2.10.2' 'pylint>=2.10.2' + + substituteInPlace setup.py \ + --replace "{VERSION}" "${version}" + ''; + + # disabled because tests try to fetch go packages from the net + doCheck = false; + + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0ed03be8d5e..39083d2a46e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1103,6 +1103,8 @@ in { babelgladeextractor = callPackage ../development/python-modules/babelgladeextractor { }; + pulumi = callPackage ../development/python-modules/pulumi { }; + backcall = callPackage ../development/python-modules/backcall { }; backoff = callPackage ../development/python-modules/backoff { }; From 3510fba9b0b754525dad2be0c1c2e586d5326c71 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 6 Mar 2022 22:05:17 +0100 Subject: [PATCH 2/3] python3Packages.pulumi-aws: init at 4.38.0 --- .../python-modules/pulumi-aws/default.nix | 44 +++++++++++++++++++ .../python-modules/pulumi/default.nix | 35 +++++---------- pkgs/top-level/python-packages.nix | 2 + 3 files changed, 57 insertions(+), 24 deletions(-) create mode 100644 pkgs/development/python-modules/pulumi-aws/default.nix diff --git a/pkgs/development/python-modules/pulumi-aws/default.nix b/pkgs/development/python-modules/pulumi-aws/default.nix new file mode 100644 index 00000000000..1b6eed0d31a --- /dev/null +++ b/pkgs/development/python-modules/pulumi-aws/default.nix @@ -0,0 +1,44 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, pulumi +, parver +, semver +, isPy27 +}: + +buildPythonPackage rec { + pname = "pulumi-aws"; + # version is independant of pulumi's. + version = "5.3.0"; + disabled = isPy27; + + src = fetchFromGitHub { + owner = "pulumi"; + repo = "pulumi-aws"; + rev = "v${version}"; + sha256 = "sha256-LrWiNYJeQQvXJDOxklRO86VSiaadvkOepQVPhh2BBkk="; + }; + + propagatedBuildInputs = [ + pulumi + parver + semver + ]; + + postPatch = '' + cd sdk/python + ''; + + # checks require cloud resources + doCheck = false; + pythonImportsCheck = ["pulumi_aws"]; + + meta = with lib; { + description = "Pulumi python amazon web services provider"; + homepage = "https://github.com/pulumi/pulumi-aws"; + license = licenses.asl20; + maintainers = with maintainers; [ costrouc ]; + }; +} diff --git a/pkgs/development/python-modules/pulumi/default.nix b/pkgs/development/python-modules/pulumi/default.nix index 3f1d5205f2c..e38157c6907 100644 --- a/pkgs/development/python-modules/pulumi/default.nix +++ b/pkgs/development/python-modules/pulumi/default.nix @@ -11,6 +11,7 @@ , pyyaml , six + # for tests , tox , go @@ -26,27 +27,20 @@ , mypy }: - +let + data = import ./data.nix {}; +in buildPythonPackage rec { pname = "pulumi"; - version = pulumi.version; + version = pulumi-bin.version; disabled = isPy27; - src = pulumi.src; - - patches = [ - # remove in next release - (fetchpatch { - url = "https://github.com/pulumi/pulumi/commit/d4b9d61d70972d22a344419fafc30aace58607f5.patch"; - sha256 = "HEF7VWunFO+NCG18fZA7lbE2l8pc6Z3jcD+rSZ1Jsqg="; - }) ]; - - # src = fetchFromGitHub { - # owner = "pulumi"; - # repo = "pulumi"; - # rev = "073e94a0b8b4ef0b1b856c63670a8dd88f6b6d02"; - # sha256 = "sha256-oyjQW/Z1NvsHpUwikX+bl1npfF4LESOua/o1qjqAgUs="; - # }; + src = fetchFromGitHub { + owner = "pulumi"; + repo = "pulumi"; + rev = "v${pulumi-bin.version}"; + sha256 = "sha256-vqEZEHTpJV65a3leWwYhyi3dzAsN67BXOvk5hnTPeuI="; + }; propagatedBuildInputs = [ semver @@ -64,7 +58,6 @@ buildPythonPackage rec { bash go tox - # pylint pytest pytest-timeout coverage @@ -79,12 +72,6 @@ buildPythonPackage rec { cp README.md sdk/python/lib patchShebangs . cd sdk/python/lib - substituteInPlace ../Makefile \ - --replace '$(shell cd ../../ && pulumictl get version)' '${pulumi-bin.version}' \ - --replace '$(shell cd ../../ && pulumictl get version --language python)' '${version}' - - substituteInPlace ../requirements.txt \ - --replace 'pylint==2.10.2' 'pylint>=2.10.2' substituteInPlace setup.py \ --replace "{VERSION}" "${version}" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 39083d2a46e..8099eb468cd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1105,6 +1105,8 @@ in { pulumi = callPackage ../development/python-modules/pulumi { }; + pulumi-aws = callPackage ../development/python-modules/pulumi-aws { }; + backcall = callPackage ../development/python-modules/backcall { }; backoff = callPackage ../development/python-modules/backoff { }; From fa2393f03111219bf855ca325ac486ad971103bc Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Wed, 20 Apr 2022 00:44:41 +0200 Subject: [PATCH 3/3] pulumi: update updater so that it can work even with an empty NIX_PATH --- pkgs/tools/admin/pulumi/update-pulumi-shell.nix | 8 ++++++++ pkgs/tools/admin/pulumi/update.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/admin/pulumi/update-pulumi-shell.nix diff --git a/pkgs/tools/admin/pulumi/update-pulumi-shell.nix b/pkgs/tools/admin/pulumi/update-pulumi-shell.nix new file mode 100644 index 00000000000..cf69e640550 --- /dev/null +++ b/pkgs/tools/admin/pulumi/update-pulumi-shell.nix @@ -0,0 +1,8 @@ +{ nixpkgs ? import ../../../.. { } }: +with nixpkgs; +mkShell { + packages = [ + pkgs.gh + ]; +} + diff --git a/pkgs/tools/admin/pulumi/update.sh b/pkgs/tools/admin/pulumi/update.sh index fadc64cf1df..1097759c3bd 100755 --- a/pkgs/tools/admin/pulumi/update.sh +++ b/pkgs/tools/admin/pulumi/update.sh @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p gh +#!nix-shell update-pulumi-shell.nix -i bash # shellcheck shell=bash # Bash 3 compatible for Darwin