pulumi/sdk/python/Makefile

49 lines
1.5 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/pkg/cmd/pulumi-language-python
VERSION := $(shell ../../scripts/get-py-version HEAD)
PYENV := ./env
PYENVSRC := $(PYENV)/src
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
ensure::
pipenv --python 3 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}/$(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/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::
2020-01-17 23:45:08 +01:00
pipenv run mypy ./lib/pulumi --config-file=mypy.ini
pipenv run pylint ./lib/pulumi --rcfile=.pylintrc
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_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)"
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::
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/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
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
test_fast::
pipenv run pip install ./env/src
pipenv run python -m unittest discover -s lib/test -v
test_all:: test_fast
dist::
go install -ldflags "-X github.com/pulumi/pulumi/sdk/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/