Skip to content

Commit

Permalink
Update GitHub Actions workflows. (#2813)
Browse files Browse the repository at this point in the history
This change enables Python wheel build and publishing to PyPI, opts the project into pyproject.toml usage.

This PR was automatically generated by the deploy-single-provider
workflow in the pulumi/ci-mgmt repo, from commit
cfd695f7851c85d4bca53f65920efc1672b00ad9.
  • Loading branch information
pulumi-bot committed Sep 15, 2023
1 parent 89a066f commit d42c22a
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Publish SDKs
uses: pulumi/pulumi-package-publisher@v0.0.9
uses: pulumi/pulumi-package-publisher@v0.0.11
- env:
SLACK_CHANNEL: provider-upgrade-publish-status
SLACK_COLOR: "#FF0000"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Publish SDKs
uses: pulumi/pulumi-package-publisher@v0.0.9
uses: pulumi/pulumi-package-publisher@v0.0.11
- env:
SLACK_CHANNEL: provider-upgrade-publish-status
SLACK_COLOR: "#FF0000"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Publish SDKs
uses: pulumi/pulumi-package-publisher@v0.0.9
uses: pulumi/pulumi-package-publisher@v0.0.11
- env:
SLACK_CHANNEL: provider-upgrade-publish-status
SLACK_COLOR: "#FF0000"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Publish SDKs
uses: pulumi/pulumi-package-publisher@v0.0.9
uses: pulumi/pulumi-package-publisher@v0.0.11
- env:
SLACK_CHANNEL: provider-upgrade-publish-status
SLACK_COLOR: "#FF0000"
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,18 @@ build_nodejs: upstream

build_python: PYPI_VERSION := $(shell pulumictl get version --language python)
build_python: upstream
rm -rf sdk/python/
$(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/
cd sdk/python/ && \
printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \
cp ../../README.md . && \
python3 setup.py clean --all 2>/dev/null && \
rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \
sed -i.bak -e 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' -e 's/^PLUGIN_VERSION = .*/PLUGIN_VERSION = "$(VERSION)"/g' ./bin/setup.py && \
rm ./bin/setup.py.bak && rm ./bin/go.mod && \
cd ./bin && python3 setup.py build sdist
sed -i.bak -e 's/^ version = .*/ version = "$(PYPI_VERSION)"/g' ./bin/pyproject.toml && \
rm ./bin/pyproject.toml.bak && rm ./bin/go.mod && \
python3 -m venv venv && \
./venv/bin/python -m pip install build && \
cd ./bin && \
../venv/bin/python -m build .

clean:
rm -rf sdk/{dotnet,nodejs,go,python}
Expand Down
6 changes: 4 additions & 2 deletions provider/cmd/pulumi-resource-aws/schema.json

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -6885,11 +6885,15 @@ $ pulumi import aws:networkfirewall/resourcePolicy:ResourcePolicy example arn:aw
},
},
},
Python: &tfbridge.PythonInfo{
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
},
},
Python: (func() *tfbridge.PythonInfo {
i := &tfbridge.PythonInfo{
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
}}
i.PyProject.Enabled = true
return i
})(),

Golang: &tfbridge.GolangInfo{
ImportBasePath: filepath.Join(
fmt.Sprintf("github.com/pulumi/pulumi-%[1]s/sdk/", awsPkg),
Expand Down
3 changes: 0 additions & 3 deletions sdk/python/VERSION

This file was deleted.

22 changes: 22 additions & 0 deletions sdk/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[project]
name = "pulumi_aws"
description = "A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources."
dependencies = ["parver>=0.2.1", "pulumi>=3.0.0,<4.0.0", "semver>=2.8.1"]
keywords = ["pulumi", "aws"]
readme = "README.md"
requires-python = ">=3.7"
version = "0.0.0"
[project.license]
text = "Apache-2.0"
[project.urls]
Homepage = "https://pulumi.io"
Repository = "https://github.com/pulumi/pulumi-aws"

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool]
[tool.setuptools]
[tool.setuptools.package-data]
pulumi_aws = ["py.typed", "pulumi-plugin.json"]
44 changes: 0 additions & 44 deletions sdk/python/setup.py

This file was deleted.

0 comments on commit d42c22a

Please sign in to comment.