pulumi/sdk/python/Makefile

83 lines
3.3 KiB
Makefile
Raw Normal View History

Get the empty Python program working This change gets enough of the Python SDK up and running that the empty Python program will work. Mostly just scaffolding, but the basic structure is now in place. The primary remaining work is to wire up resource creation to the gRPC interfaces. In summary: * The basic structure is as follows: - Everything goes into sdk/python/. - sdk/python/cmd/pulumi-langhost-python is a Go language host that simply knows how to spawn Python processes to run out entrypoint in response to requests by the engine. - sdk/python/cmd/pulumi-langhost-python-exec is a little Python shim that is invoked by the language host to run Python programs, and is responsible for setting up the minimal goo before we can do so (RPC connections and the like). - sdk/python/lib/ contains a Python Pip package suitable for PyPi. - In there, we have two packages: the root pulumi package that contains all of the basic Pulumi programming model abstractions, and pulumi.runtime, which contains the implementation of resource registration, RPC interfacing with the engine, and so on. * Add logic in our test framework to conditionalize on the language type and react accordingly. This will allow us to skip Yarn for Python projects and eventually run Pip if there's a requirements.txt. * Created the basic project structure, including all of the usual Make targets for installing into the proper places. * Building also runs Pylint and we are clean. There are a few other minor things in here: * Add an "empty" test for both Node.js and Python. These pass. * Fix an existing bug in plugin shutdown logic. At some point, we started waiting for stderr/stdout to flush before shutting down the plugin; but if certain failures happen "early" during the plugin launch process, these channels will never get initialized and so waiting for them deadlocks. * Recently we seem to have added logic to delete test temp directories if a failure happened during initialization of said temp directories. This is unfortunate, because you often need to look at the temp directory to see what failed. We already clean them up elsewhere after the full test completes successfully, so I don't think we need to be doing this, and I've removed it. Still many loose ends (config, resources, etc), but it's a start!
2018-01-13 19:29:34 +01:00
PROJECT_NAME := Pulumi Python SDK
LANGHOST_PKG := github.com/pulumi/pulumi/sdk/v3/python/cmd/pulumi-language-python
VERSION := $(shell cd ../../ && pulumictl get version)
PYPI_VERSION := $(shell cd ../../ && pulumictl get version --language python)
PROJECT_ROOT := $(realpath ../..)
PYENV := ./env
PYENVSRC := $(PYENV)/src
PROJECT_PKGS := $(shell go list ./cmd/...)
TESTPARALLELISM := 10
Get the empty Python program working This change gets enough of the Python SDK up and running that the empty Python program will work. Mostly just scaffolding, but the basic structure is now in place. The primary remaining work is to wire up resource creation to the gRPC interfaces. In summary: * The basic structure is as follows: - Everything goes into sdk/python/. - sdk/python/cmd/pulumi-langhost-python is a Go language host that simply knows how to spawn Python processes to run out entrypoint in response to requests by the engine. - sdk/python/cmd/pulumi-langhost-python-exec is a little Python shim that is invoked by the language host to run Python programs, and is responsible for setting up the minimal goo before we can do so (RPC connections and the like). - sdk/python/lib/ contains a Python Pip package suitable for PyPi. - In there, we have two packages: the root pulumi package that contains all of the basic Pulumi programming model abstractions, and pulumi.runtime, which contains the implementation of resource registration, RPC interfacing with the engine, and so on. * Add logic in our test framework to conditionalize on the language type and react accordingly. This will allow us to skip Yarn for Python projects and eventually run Pip if there's a requirements.txt. * Created the basic project structure, including all of the usual Make targets for installing into the proper places. * Building also runs Pylint and we are clean. There are a few other minor things in here: * Add an "empty" test for both Node.js and Python. These pass. * Fix an existing bug in plugin shutdown logic. At some point, we started waiting for stderr/stdout to flush before shutting down the plugin; but if certain failures happen "early" during the plugin launch process, these channels will never get initialized and so waiting for them deadlocks. * Recently we seem to have added logic to delete test temp directories if a failure happened during initialization of said temp directories. This is unfortunate, because you often need to look at the temp directory to see what failed. We already clean them up elsewhere after the full test completes successfully, so I don't think we need to be doing this, and I've removed it. Still many loose ends (config, resources, etc), but it's a start!
2018-01-13 19:29:34 +01:00
include ../../build/common.mk
# Motivation: running `make TEST_ALL_DEPS= test_all` permits running
# `test_all` without the dependencies.
TEST_ALL_DEPS = build
Get the empty Python program working This change gets enough of the Python SDK up and running that the empty Python program will work. Mostly just scaffolding, but the basic structure is now in place. The primary remaining work is to wire up resource creation to the gRPC interfaces. In summary: * The basic structure is as follows: - Everything goes into sdk/python/. - sdk/python/cmd/pulumi-langhost-python is a Go language host that simply knows how to spawn Python processes to run out entrypoint in response to requests by the engine. - sdk/python/cmd/pulumi-langhost-python-exec is a little Python shim that is invoked by the language host to run Python programs, and is responsible for setting up the minimal goo before we can do so (RPC connections and the like). - sdk/python/lib/ contains a Python Pip package suitable for PyPi. - In there, we have two packages: the root pulumi package that contains all of the basic Pulumi programming model abstractions, and pulumi.runtime, which contains the implementation of resource registration, RPC interfacing with the engine, and so on. * Add logic in our test framework to conditionalize on the language type and react accordingly. This will allow us to skip Yarn for Python projects and eventually run Pip if there's a requirements.txt. * Created the basic project structure, including all of the usual Make targets for installing into the proper places. * Building also runs Pylint and we are clean. There are a few other minor things in here: * Add an "empty" test for both Node.js and Python. These pass. * Fix an existing bug in plugin shutdown logic. At some point, we started waiting for stderr/stdout to flush before shutting down the plugin; but if certain failures happen "early" during the plugin launch process, these channels will never get initialized and so waiting for them deadlocks. * Recently we seem to have added logic to delete test temp directories if a failure happened during initialization of said temp directories. This is unfortunate, because you often need to look at the temp directory to see what failed. We already clean them up elsewhere after the full test completes successfully, so I don't think we need to be doing this, and I've removed it. Still many loose ends (config, resources, etc), but it's a start!
2018-01-13 19:29:34 +01:00
ensure::
pipenv install --dev
mkdir -p $(PYENVSRC)
Add a Dockerfile for the Pulumi CLI This introduces a Dockerfile for the Pulumi CLI. This makes it easier to develop and test the engine in a self-contained environment, in addition to being suitable for running the actual CLI itself. For instance, $ docker run pulumi/pulumi -e "PULUMI_ACCESS_TOKEN=x" up will run the Pulumi program mounted under the /app volume. This will be used in some upcoming CI/CD scenarios. This uses multi-stage builds, and Debian Stretch as the base, for relatively fast and lean build times and resulting images. We are intentional about restoring dep packages independent of the actual source code so that we don't end up needlessly re-depping, which can consume quite a bit of time. After fixing https://github.com/pulumi/pulumi/issues/1986, we should explore an Alpine base image option. I made the decision to keep this image scoped to just the Go builds. Therefore, none of the actual SDK packages themselves are built, just the engine, CLI, and language plugins for Node.js, Python, and Go. It's possible to create a mega-container that has all of these full environments so that we can rebuild them too, but for now I figured it was better to rely on package management for them. Another alternative would have been to install released binaries, rather than building them. To keep the useful flow for development, however, I decided to go the build route for now. If we build at the same hashes, the resulting binaries "should" be ~identical anyhow. I've created a pulumi/pulumi Docker Hub repo that we can publish this into. For now, there is no CI publishing of the image. This fixes pulumi/pulumi#1991.
2018-09-29 20:43:35 +02:00
build_package::
rm -rf $(PYENVSRC) && cp -R ./lib/. $(PYENVSRC)/
sed -i.bak "s/\$${VERSION}/$(PYPI_VERSION)/g" $(PYENVSRC)/setup.py && rm $(PYENVSRC)/setup.py.bak
cp ../../README.md $(PYENVSRC)
cd $(PYENVSRC) && pipenv run python setup.py build bdist_wheel --universal
Add a Dockerfile for the Pulumi CLI This introduces a Dockerfile for the Pulumi CLI. This makes it easier to develop and test the engine in a self-contained environment, in addition to being suitable for running the actual CLI itself. For instance, $ docker run pulumi/pulumi -e "PULUMI_ACCESS_TOKEN=x" up will run the Pulumi program mounted under the /app volume. This will be used in some upcoming CI/CD scenarios. This uses multi-stage builds, and Debian Stretch as the base, for relatively fast and lean build times and resulting images. We are intentional about restoring dep packages independent of the actual source code so that we don't end up needlessly re-depping, which can consume quite a bit of time. After fixing https://github.com/pulumi/pulumi/issues/1986, we should explore an Alpine base image option. I made the decision to keep this image scoped to just the Go builds. Therefore, none of the actual SDK packages themselves are built, just the engine, CLI, and language plugins for Node.js, Python, and Go. It's possible to create a mega-container that has all of these full environments so that we can rebuild them too, but for now I figured it was better to rely on package management for them. Another alternative would have been to install released binaries, rather than building them. To keep the useful flow for development, however, I decided to go the build route for now. If we build at the same hashes, the resulting binaries "should" be ~identical anyhow. I've created a pulumi/pulumi Docker Hub repo that we can publish this into. For now, there is no CI publishing of the image. This fixes pulumi/pulumi#1991.
2018-09-29 20:43:35 +02:00
build_plugin::
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=${VERSION}" ${LANGHOST_PKG}
Add a Dockerfile for the Pulumi CLI This introduces a Dockerfile for the Pulumi CLI. This makes it easier to develop and test the engine in a self-contained environment, in addition to being suitable for running the actual CLI itself. For instance, $ docker run pulumi/pulumi -e "PULUMI_ACCESS_TOKEN=x" up will run the Pulumi program mounted under the /app volume. This will be used in some upcoming CI/CD scenarios. This uses multi-stage builds, and Debian Stretch as the base, for relatively fast and lean build times and resulting images. We are intentional about restoring dep packages independent of the actual source code so that we don't end up needlessly re-depping, which can consume quite a bit of time. After fixing https://github.com/pulumi/pulumi/issues/1986, we should explore an Alpine base image option. I made the decision to keep this image scoped to just the Go builds. Therefore, none of the actual SDK packages themselves are built, just the engine, CLI, and language plugins for Node.js, Python, and Go. It's possible to create a mega-container that has all of these full environments so that we can rebuild them too, but for now I figured it was better to rely on package management for them. Another alternative would have been to install released binaries, rather than building them. To keep the useful flow for development, however, I decided to go the build route for now. If we build at the same hashes, the resulting binaries "should" be ~identical anyhow. I've created a pulumi/pulumi Docker Hub repo that we can publish this into. For now, there is no CI publishing of the image. This fixes pulumi/pulumi#1991.
2018-09-29 20:43:35 +02:00
build:: build_package build_plugin
Get the empty Python program working This change gets enough of the Python SDK up and running that the empty Python program will work. Mostly just scaffolding, but the basic structure is now in place. The primary remaining work is to wire up resource creation to the gRPC interfaces. In summary: * The basic structure is as follows: - Everything goes into sdk/python/. - sdk/python/cmd/pulumi-langhost-python is a Go language host that simply knows how to spawn Python processes to run out entrypoint in response to requests by the engine. - sdk/python/cmd/pulumi-langhost-python-exec is a little Python shim that is invoked by the language host to run Python programs, and is responsible for setting up the minimal goo before we can do so (RPC connections and the like). - sdk/python/lib/ contains a Python Pip package suitable for PyPi. - In there, we have two packages: the root pulumi package that contains all of the basic Pulumi programming model abstractions, and pulumi.runtime, which contains the implementation of resource registration, RPC interfacing with the engine, and so on. * Add logic in our test framework to conditionalize on the language type and react accordingly. This will allow us to skip Yarn for Python projects and eventually run Pip if there's a requirements.txt. * Created the basic project structure, including all of the usual Make targets for installing into the proper places. * Building also runs Pylint and we are clean. There are a few other minor things in here: * Add an "empty" test for both Node.js and Python. These pass. * Fix an existing bug in plugin shutdown logic. At some point, we started waiting for stderr/stdout to flush before shutting down the plugin; but if certain failures happen "early" during the plugin launch process, these channels will never get initialized and so waiting for them deadlocks. * Recently we seem to have added logic to delete test temp directories if a failure happened during initialization of said temp directories. This is unfortunate, because you often need to look at the temp directory to see what failed. We already clean them up elsewhere after the full test completes successfully, so I don't think we need to be doing this, and I've removed it. Still many loose ends (config, resources, etc), but it's a start!
2018-01-13 19:29:34 +01:00
lint::
MYPYPATH=./stubs pipenv run mypy ./lib/pulumi --config-file=mypy.ini
pipenv run pylint ./lib/pulumi --rcfile=.pylintrc
install_package:: build_package
Get the empty Python program working This change gets enough of the Python SDK up and running that the empty Python program will work. Mostly just scaffolding, but the basic structure is now in place. The primary remaining work is to wire up resource creation to the gRPC interfaces. In summary: * The basic structure is as follows: - Everything goes into sdk/python/. - sdk/python/cmd/pulumi-langhost-python is a Go language host that simply knows how to spawn Python processes to run out entrypoint in response to requests by the engine. - sdk/python/cmd/pulumi-langhost-python-exec is a little Python shim that is invoked by the language host to run Python programs, and is responsible for setting up the minimal goo before we can do so (RPC connections and the like). - sdk/python/lib/ contains a Python Pip package suitable for PyPi. - In there, we have two packages: the root pulumi package that contains all of the basic Pulumi programming model abstractions, and pulumi.runtime, which contains the implementation of resource registration, RPC interfacing with the engine, and so on. * Add logic in our test framework to conditionalize on the language type and react accordingly. This will allow us to skip Yarn for Python projects and eventually run Pip if there's a requirements.txt. * Created the basic project structure, including all of the usual Make targets for installing into the proper places. * Building also runs Pylint and we are clean. There are a few other minor things in here: * Add an "empty" test for both Node.js and Python. These pass. * Fix an existing bug in plugin shutdown logic. At some point, we started waiting for stderr/stdout to flush before shutting down the plugin; but if certain failures happen "early" during the plugin launch process, these channels will never get initialized and so waiting for them deadlocks. * Recently we seem to have added logic to delete test temp directories if a failure happened during initialization of said temp directories. This is unfortunate, because you often need to look at the temp directory to see what failed. We already clean them up elsewhere after the full test completes successfully, so I don't think we need to be doing this, and I've removed it. Still many loose ends (config, resources, etc), but it's a start!
2018-01-13 19:29:34 +01:00
cp ./cmd/pulumi-language-python-exec "$(PULUMI_BIN)"
Python Dynamic Providers (#2900) Dynamic providers in Python. This PR uses [dill](https://pypi.org/project/dill/) for code serialization, along with a customization to help ensure deterministic serialization results. One notable limitation - which I believe is a general requirement of Python - is that any serialization of Python functions must serialize byte code, and byte code is not safely versioned across Python versions. So any resource created with Python `3.x.y` can only be updated by exactly the same version of Python. This is very constraining, but it's not clear there is any other option within the realm of what "dynamic providers" are as a feature. It is plausible that we could ensure that updates which only update the serialized provider can avoid calling the dynamic provider operations, so that version updates could still be accomplished. We can explore this separately. ```py from pulumi import ComponentResource, export, Input, Output from pulumi.dynamic import Resource, ResourceProvider, CreateResult, UpdateResult from typing import Optional from github import Github, GithubObject auth = "<auth token>" g = Github(auth) class GithubLabelArgs(object): owner: Input[str] repo: Input[str] name: Input[str] color: Input[str] description: Optional[Input[str]] def __init__(self, owner, repo, name, color, description=None): self.owner = owner self.repo = repo self.name = name self.color = color self.description = description class GithubLabelProvider(ResourceProvider): def create(self, props): l = g.get_user(props["owner"]).get_repo(props["repo"]).create_label( name=props["name"], color=props["color"], description=props.get("description", GithubObject.NotSet)) return CreateResult(l.name, {**props, **l.raw_data}) def update(self, id, _olds, props): l = g.get_user(props["owner"]).get_repo(props["repo"]).get_label(id) l.edit(name=props["name"], color=props["color"], description=props.get("description", GithubObject.NotSet)) return UpdateResult({**props, **l.raw_data}) def delete(self, id, props): l = g.get_user(props["owner"]).get_repo(props["repo"]).get_label(id) l.delete() class GithubLabel(Resource): name: Output[str] color: Output[str] url: Output[str] description: Output[str] def __init__(self, name, args: GithubLabelArgs, opts = None): full_args = {'url':None, 'description':None, 'name':None, 'color':None, **vars(args)} super().__init__(GithubLabelProvider(), name, full_args, opts) label = GithubLabel("foo", GithubLabelArgs("lukehoban", "todo", "mylabel", "d94f0b")) export("label_color", label.color) export("label_url", label.url) ``` Fixes https://github.com/pulumi/pulumi/issues/2902.
2019-07-19 19:18:25 +02:00
cp ./dist/pulumi-resource-pulumi-python "$(PULUMI_BIN)"
cp ./dist/pulumi-analyzer-policy-python "$(PULUMI_BIN)"
Add a Dockerfile for the Pulumi CLI This introduces a Dockerfile for the Pulumi CLI. This makes it easier to develop and test the engine in a self-contained environment, in addition to being suitable for running the actual CLI itself. For instance, $ docker run pulumi/pulumi -e "PULUMI_ACCESS_TOKEN=x" up will run the Pulumi program mounted under the /app volume. This will be used in some upcoming CI/CD scenarios. This uses multi-stage builds, and Debian Stretch as the base, for relatively fast and lean build times and resulting images. We are intentional about restoring dep packages independent of the actual source code so that we don't end up needlessly re-depping, which can consume quite a bit of time. After fixing https://github.com/pulumi/pulumi/issues/1986, we should explore an Alpine base image option. I made the decision to keep this image scoped to just the Go builds. Therefore, none of the actual SDK packages themselves are built, just the engine, CLI, and language plugins for Node.js, Python, and Go. It's possible to create a mega-container that has all of these full environments so that we can rebuild them too, but for now I figured it was better to rely on package management for them. Another alternative would have been to install released binaries, rather than building them. To keep the useful flow for development, however, I decided to go the build route for now. If we build at the same hashes, the resulting binaries "should" be ~identical anyhow. I've created a pulumi/pulumi Docker Hub repo that we can publish this into. For now, there is no CI publishing of the image. This fixes pulumi/pulumi#1991.
2018-09-29 20:43:35 +02:00
install_plugin:: build_plugin
Get the empty Python program working This change gets enough of the Python SDK up and running that the empty Python program will work. Mostly just scaffolding, but the basic structure is now in place. The primary remaining work is to wire up resource creation to the gRPC interfaces. In summary: * The basic structure is as follows: - Everything goes into sdk/python/. - sdk/python/cmd/pulumi-langhost-python is a Go language host that simply knows how to spawn Python processes to run out entrypoint in response to requests by the engine. - sdk/python/cmd/pulumi-langhost-python-exec is a little Python shim that is invoked by the language host to run Python programs, and is responsible for setting up the minimal goo before we can do so (RPC connections and the like). - sdk/python/lib/ contains a Python Pip package suitable for PyPi. - In there, we have two packages: the root pulumi package that contains all of the basic Pulumi programming model abstractions, and pulumi.runtime, which contains the implementation of resource registration, RPC interfacing with the engine, and so on. * Add logic in our test framework to conditionalize on the language type and react accordingly. This will allow us to skip Yarn for Python projects and eventually run Pip if there's a requirements.txt. * Created the basic project structure, including all of the usual Make targets for installing into the proper places. * Building also runs Pylint and we are clean. There are a few other minor things in here: * Add an "empty" test for both Node.js and Python. These pass. * Fix an existing bug in plugin shutdown logic. At some point, we started waiting for stderr/stdout to flush before shutting down the plugin; but if certain failures happen "early" during the plugin launch process, these channels will never get initialized and so waiting for them deadlocks. * Recently we seem to have added logic to delete test temp directories if a failure happened during initialization of said temp directories. This is unfortunate, because you often need to look at the temp directory to see what failed. We already clean them up elsewhere after the full test completes successfully, so I don't think we need to be doing this, and I've removed it. Still many loose ends (config, resources, etc), but it's a start!
2018-01-13 19:29:34 +01:00
GOBIN=$(PULUMI_BIN) go install \
-ldflags "-X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=${VERSION}" ${LANGHOST_PKG}
Add a Dockerfile for the Pulumi CLI This introduces a Dockerfile for the Pulumi CLI. This makes it easier to develop and test the engine in a self-contained environment, in addition to being suitable for running the actual CLI itself. For instance, $ docker run pulumi/pulumi -e "PULUMI_ACCESS_TOKEN=x" up will run the Pulumi program mounted under the /app volume. This will be used in some upcoming CI/CD scenarios. This uses multi-stage builds, and Debian Stretch as the base, for relatively fast and lean build times and resulting images. We are intentional about restoring dep packages independent of the actual source code so that we don't end up needlessly re-depping, which can consume quite a bit of time. After fixing https://github.com/pulumi/pulumi/issues/1986, we should explore an Alpine base image option. I made the decision to keep this image scoped to just the Go builds. Therefore, none of the actual SDK packages themselves are built, just the engine, CLI, and language plugins for Node.js, Python, and Go. It's possible to create a mega-container that has all of these full environments so that we can rebuild them too, but for now I figured it was better to rely on package management for them. Another alternative would have been to install released binaries, rather than building them. To keep the useful flow for development, however, I decided to go the build route for now. If we build at the same hashes, the resulting binaries "should" be ~identical anyhow. I've created a pulumi/pulumi Docker Hub repo that we can publish this into. For now, there is no CI publishing of the image. This fixes pulumi/pulumi#1991.
2018-09-29 20:43:35 +02:00
install:: install_package install_plugin
test_fast:: $(TEST_ALL_DEPS)
$(GO_TEST) ${PROJECT_PKGS}
pipenv install -e ./env/src
# TODO the ignored test seems to fail in pytest but not unittest. Need to trackdown why
$(RUN_TESTSUITE) python/lib/test pipenv run pytest lib/test --ignore lib/test/automation --ignore lib/test/langhost/resource_thens/test_resource_thens.py
$(RUN_TESTSUITE) python/lib/test/langhost/resource_thens pipenv run python -m unittest lib/test/langhost/resource_thens/test_resource_thens.py
# Using python -m also adds lib/test_with_mocks to sys.path which avoids package resolution issues.
pushd lib/test_with_mocks; $(RUN_TESTSUITE) python/lib/test_with_mocks pipenv run python -m pytest; popd
test_auto:: test_fast $(TEST_ALL_DEPS)
# Note that this target depends on test-fast for the call to `pipenv run pip install`
$(RUN_TESTSUITE) auto-python pipenv run pytest lib/test/automation
test_all:: test_fast test_auto
dist::
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=${VERSION}" ${LANGHOST_PKG}
cp ./cmd/pulumi-language-python-exec "$$(go env GOPATH)"/bin/
Python Dynamic Providers (#2900) Dynamic providers in Python. This PR uses [dill](https://pypi.org/project/dill/) for code serialization, along with a customization to help ensure deterministic serialization results. One notable limitation - which I believe is a general requirement of Python - is that any serialization of Python functions must serialize byte code, and byte code is not safely versioned across Python versions. So any resource created with Python `3.x.y` can only be updated by exactly the same version of Python. This is very constraining, but it's not clear there is any other option within the realm of what "dynamic providers" are as a feature. It is plausible that we could ensure that updates which only update the serialized provider can avoid calling the dynamic provider operations, so that version updates could still be accomplished. We can explore this separately. ```py from pulumi import ComponentResource, export, Input, Output from pulumi.dynamic import Resource, ResourceProvider, CreateResult, UpdateResult from typing import Optional from github import Github, GithubObject auth = "<auth token>" g = Github(auth) class GithubLabelArgs(object): owner: Input[str] repo: Input[str] name: Input[str] color: Input[str] description: Optional[Input[str]] def __init__(self, owner, repo, name, color, description=None): self.owner = owner self.repo = repo self.name = name self.color = color self.description = description class GithubLabelProvider(ResourceProvider): def create(self, props): l = g.get_user(props["owner"]).get_repo(props["repo"]).create_label( name=props["name"], color=props["color"], description=props.get("description", GithubObject.NotSet)) return CreateResult(l.name, {**props, **l.raw_data}) def update(self, id, _olds, props): l = g.get_user(props["owner"]).get_repo(props["repo"]).get_label(id) l.edit(name=props["name"], color=props["color"], description=props.get("description", GithubObject.NotSet)) return UpdateResult({**props, **l.raw_data}) def delete(self, id, props): l = g.get_user(props["owner"]).get_repo(props["repo"]).get_label(id) l.delete() class GithubLabel(Resource): name: Output[str] color: Output[str] url: Output[str] description: Output[str] def __init__(self, name, args: GithubLabelArgs, opts = None): full_args = {'url':None, 'description':None, 'name':None, 'color':None, **vars(args)} super().__init__(GithubLabelProvider(), name, full_args, opts) label = GithubLabel("foo", GithubLabelArgs("lukehoban", "todo", "mylabel", "d94f0b")) export("label_color", label.color) export("label_url", label.url) ``` Fixes https://github.com/pulumi/pulumi/issues/2902.
2019-07-19 19:18:25 +02:00
cp ./dist/pulumi-resource-pulumi-python "$$(go env GOPATH)"/bin/
cp ./dist/pulumi-analyzer-policy-python "$$(go env GOPATH)"/bin/
2020-05-14 05:38:27 +02:00
Ensure that make brew works as expected rather than passing empty version (#6566) Fixes:#6565 As part of #6460, the logic for determing the version of the build was moved to be a dependency on pulumictl. Unfortunately, the homebrew installs use the "make dist" command to build + install Pulumi to the user maching and as that would have a dependency on pulumictl and it not existing on the user machine, it would pass an empty version to the ldflag This then manifested to the user as: ``` ▶ pulumi version warning: A new version of Pulumi is available. To upgrade from version '0.0.0' to '2.22.0', run $ brew upgrade pulumi or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes. ``` We are able to mitigate this behaviour by bringing back the get-version script and using that script as part of the make brew installation We can see that the versions are the same between the 2 different installation techniques ``` make dist <------- uses pulumict DIST: go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=2.24.0-alpha.1616029310+787eb70a" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet DIST: BUILD: ``` ``` make brew <----- uses the legacy script ▶ make brew BREW: go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=v2.24.0-alpha.1616029310+g787eb70a2" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet BREW: ``` A full post mortem will be carried out to ensure we mitigate these types of errors going forward and that we are able to better test these types of situations
2021-03-18 03:07:02 +01:00
brew:: BREW_VERSION := $(shell ../../scripts/get-version HEAD)
brew::
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v3/go/common/version.Version=${BREW_VERSION}" ${LANGHOST_PKG}
Ensure that make brew works as expected rather than passing empty version (#6566) Fixes:#6565 As part of #6460, the logic for determing the version of the build was moved to be a dependency on pulumictl. Unfortunately, the homebrew installs use the "make dist" command to build + install Pulumi to the user maching and as that would have a dependency on pulumictl and it not existing on the user machine, it would pass an empty version to the ldflag This then manifested to the user as: ``` ▶ pulumi version warning: A new version of Pulumi is available. To upgrade from version '0.0.0' to '2.22.0', run $ brew upgrade pulumi or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes. ``` We are able to mitigate this behaviour by bringing back the get-version script and using that script as part of the make brew installation We can see that the versions are the same between the 2 different installation techniques ``` make dist <------- uses pulumict DIST: go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=2.24.0-alpha.1616029310+787eb70a" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet DIST: BUILD: ``` ``` make brew <----- uses the legacy script ▶ make brew BREW: go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=v2.24.0-alpha.1616029310+g787eb70a2" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet BREW: ``` A full post mortem will be carried out to ensure we mitigate these types of errors going forward and that we are able to better test these types of situations
2021-03-18 03:07:02 +01:00
cp ./cmd/pulumi-language-python-exec "$$(go env GOPATH)"/bin/
cp ./dist/pulumi-resource-pulumi-python "$$(go env GOPATH)"/bin/
cp ./dist/pulumi-analyzer-policy-python "$$(go env GOPATH)"/bin/
2020-09-22 01:20:05 +02:00
publish:: build_package
twine upload \
-u pulumi -p "${PYPI_PASSWORD}" \
2020-09-22 01:20:05 +02:00
"env/src/dist"/*.whl \
--skip-existing \
--verbose