Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roll out Python wheel build and publishing #926

Merged
merged 4 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ jobs:
run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# See https://github.com/pulumi/scripts/pull/138/files
# Possible values: "all", "wheel".
PYPI_PUBLISH_ARTIFACTS: all
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ jobs:
run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# See https://github.com/pulumi/scripts/pull/138/files
# Possible values: "all", "wheel".
PYPI_PUBLISH_ARTIFACTS: all
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ jobs:
run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# See https://github.com/pulumi/scripts/pull/138/files
# Possible values: "all", "wheel".
PYPI_PUBLISH_ARTIFACTS: all
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ sdk/java/.gradle
sdk/java/gradle
sdk/java/gradlew
sdk/java/gradlew.bat

sdk/python/venv
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,24 @@ build_nodejs::
sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json

generate_python::
# Delete files not tracked in Git
cd sdk/python/ && git clean -fxd

$(WORKING_DIR)/bin/$(CODEGEN) python ${VERSION}

build_python:: PYPI_VERSION := $(shell pulumictl get version --language python)
build_python::
# Delete files not tracked in Git
cd sdk/python/ && git clean -fxd
cd sdk/python/ && \
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 && \
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 && \
python3 -m venv venv && \
./venv/bin/python -m pip install build && \
cd ./bin && \
../venv/bin/python -m build .

generate_dotnet::
$(WORKING_DIR)/bin/$(CODEGEN) dotnet ${VERSION}
Expand Down
3 changes: 3 additions & 0 deletions provider/cmd/pulumi-resource-google-native/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,9 @@
"workloadmanager/v1": "workloadmanager/v1",
"workstations/v1beta": "workstations/v1beta"
},
"pyproject": {
"enabled": true
},
"readme": "The native Google Cloud Provider for Pulumi lets you provision Google Cloud resources in your cloud\nprograms. This provider uses the Google Cloud REST API directly and therefore provides full access to Google Cloud.\nThe provider is currently in public preview and is not recommended for production deployments yet. Breaking changes\nwill be introduced in minor version releases.",
"requires": {
"pulumi": "\u003e=3.0.0,\u003c4.0.0"
Expand Down
3 changes: 3 additions & 0 deletions provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ programs. This provider uses the Google Cloud REST API directly and therefore pr
The provider is currently in public preview and is not recommended for production deployments yet. Breaking changes
will be introduced in minor version releases.`,
"liftSingleValueMethodReturns": true,
"pyproject": map[string]bool{
"enabled": true,
},
})

pkg.Language["csharp"] = rawMessage(map[string]interface{}{
Expand Down
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_google_native"
description = "A native Pulumi package for creating and managing Google Cloud resources."
dependencies = ["parver>=0.2.1", "pulumi>=3.0.0,<4.0.0", "semver>=2.8.1"]
keywords = ["pulumi", "google cloud", "category/cloud", "kind/native"]
readme = "README.md"
requires-python = ">=3.7"
version = "0.0.0"
[project.license]
text = "Apache-2.0"
[project.urls]
Homepage = "https://pulumi.com"
Repository = "https://github.com/pulumi/pulumi-google-native"

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

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

This file was deleted.

Loading