Skip to content

Commit

Permalink
Feature: Python wheel-based builds and publishing (#981)
Browse files Browse the repository at this point in the history
This feature enables wheel-based builds and PyPI publishing for the provider's Python SDK. It is part of a larger rollout across all providers pulumi/home#2883
  • Loading branch information
t0yv0 authored Dec 1, 2023
1 parent 63def2d commit dd9ff48
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 51 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ build_python:: schema
cd sdk/python/ && \
echo "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17" > 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 && \
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 .

build_go:: VERSION := $(shell pulumictl get version --language generic)
build_go:: schema
Expand Down
3 changes: 3 additions & 0 deletions provider/cmd/pulumi-gen-eks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,9 @@ func generateSchema() schema.PackageSpec {
// TODO: Embellish the readme
"readme": "Pulumi Amazon Web Services (AWS) EKS Components.",
"liftSingleValueMethodReturns": true,
"pyproject": map[string]any{
"enabled": true,
},
}),
"go": rawMessage(map[string]interface{}{
"generateResourceContainerTypes": true,
Expand Down
3 changes: 3 additions & 0 deletions provider/cmd/pulumi-resource-eks/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
},
"python": {
"liftSingleValueMethodReturns": true,
"pyproject": {
"enabled": true
},
"readme": "Pulumi Amazon Web Services (AWS) EKS Components.",
"requires": {
"pulumi": "\u003e=3.0.0,\u003c4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ publish() {
pushd ${ROOT}/sdk/python/bin
twine upload \
-u "pulumi" -p "${PYPI_PASSWORD}" \
"dist/*.tar.gz" \
"dist/*" \
--skip-existing \
--verbose
popd
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_eks"
description = "Pulumi Amazon Web Services (AWS) EKS Components."
dependencies = ["parver>=0.2.1", "pulumi>=3.0.0,<4.0.0", "pulumi-aws>=6.0.0,<7.0.0", "pulumi-kubernetes>=4.0.0,<5.0.0", "semver>=2.8.1"]
keywords = ["pulumi", "aws", "eks"]
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-eks"

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

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

This file was deleted.

0 comments on commit dd9ff48

Please sign in to comment.