From ea35fedf6384d7c12528c60e7cf550e7f82cdb54 Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Thu, 1 Oct 2026 17:18:57 -0500 Subject: [PATCH] fix: generate SDKs with the release version The v0.33.0 release failed in publish_sdk because the Node.js SDK's package.json still had the codegen placeholder "${VERSION}". Without RespectSchemaVersion, codegen doesn't write the provider version into the SDK packages, and the old Makefile filled it in with sed. The ci-mgmt Makefile doesn't, so Python would also have been built as 0.0.0 and the .NET package had no version. Enable RespectSchemaVersion for Node.js, Python, Go and .NET, as other ci-mgmt bridged providers do, so each SDK is generated with the release version. Generate pyproject.toml instead of setup.py for Python. The version is written into the packaging file, and ci-mgmt's build_sdk worktree check allows pyproject.toml to change but not setup.py. Co-Authored-By: Claude Opus 5.5 --- .../cmd/pulumi-resource-equinix/schema.json | 14 ++++-- provider/resources.go | 8 +++- sdk/dotnet/Pulumi.Equinix.csproj | 1 + sdk/dotnet/pulumi-plugin.json | 1 + sdk/go/equinix/internal/pulumiUtilities.go | 4 +- sdk/go/equinix/pulumi-plugin.json | 1 + sdk/nodejs/package.json | 3 +- sdk/python/pulumi_equinix/pulumi-plugin.json | 1 + sdk/python/pyproject.toml | 22 +++++++++ sdk/python/setup.py | 46 ------------------- 10 files changed, 47 insertions(+), 54 deletions(-) create mode 100644 sdk/python/pyproject.toml delete mode 100644 sdk/python/setup.py diff --git a/provider/cmd/pulumi-resource-equinix/schema.json b/provider/cmd/pulumi-resource-equinix/schema.json index 0da7f4a59..b823d98d5 100644 --- a/provider/cmd/pulumi-resource-equinix/schema.json +++ b/provider/cmd/pulumi-resource-equinix/schema.json @@ -28,12 +28,14 @@ "networkedge": "NetworkEdge" }, "compatibility": "tfbridge20", - "rootNamespace": "Pulumi" + "rootNamespace": "Pulumi", + "respectSchemaVersion": true }, "go": { "importBasePath": "github.com/equinix/pulumi-equinix/sdk/go/equinix", "generateResourceContainerTypes": true, - "generateExtraInputTypes": true + "generateExtraInputTypes": true, + "respectSchemaVersion": true }, "java": { "basePackage": "com.equinix", @@ -56,7 +58,8 @@ "@types/node": "^10.0.0" }, "compatibility": "tfbridge20", - "disableUnionOutputTypes": true + "disableUnionOutputTypes": true, + "respectSchemaVersion": true }, "python": { "packageName": "pulumi_equinix", @@ -65,7 +68,10 @@ }, "readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/equinix/terraform-provider-equinix)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-equinix` repo](https://github.com/equinix/pulumi-equinix/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-equinix` repo](https://github.com/equinix/terraform-provider-equinix/issues).", "compatibility": "tfbridge20", - "pyproject": {} + "respectSchemaVersion": true, + "pyproject": { + "enabled": true + } } }, "config": { diff --git a/provider/resources.go b/provider/resources.go index 82ca49845..a260289c5 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -817,6 +817,7 @@ func Provider() tfbridge.ProviderInfo { // section, or refer to the AWS provider. Delete this section if there are // no overlay files. // Overlay: &tfbridge.OverlayInfo{}, + RespectSchemaVersion: true, }, Python: &tfbridge.PythonInfo{ PackageName: "pulumi_equinix", @@ -824,6 +825,9 @@ func Provider() tfbridge.ProviderInfo { Requires: map[string]string{ "pulumi": ">=3.0.0,<4.0.0", }, + RespectSchemaVersion: true, + // Generate pyproject.toml, which carries the package version, instead of setup.py + PyProject: struct{ Enabled bool }{true}, }, Golang: &tfbridge.GolangInfo{ ImportBasePath: filepath.Join( @@ -833,13 +837,15 @@ func Provider() tfbridge.ProviderInfo { equinixPkg, ), GenerateResourceContainerTypes: true, + RespectSchemaVersion: true, }, CSharp: &tfbridge.CSharpInfo{ RootNamespace: "Pulumi", PackageReferences: map[string]string{ "Pulumi": "3.*", }, - Namespaces: namespaceMap, + Namespaces: namespaceMap, + RespectSchemaVersion: true, }, Java: &tfbridge.JavaInfo{ BasePackage: "com.equinix", diff --git a/sdk/dotnet/Pulumi.Equinix.csproj b/sdk/dotnet/Pulumi.Equinix.csproj index add74c88c..97e19478d 100644 --- a/sdk/dotnet/Pulumi.Equinix.csproj +++ b/sdk/dotnet/Pulumi.Equinix.csproj @@ -9,6 +9,7 @@ https://deploy.equinix.com/ https://github.com/equinix/pulumi-equinix logo.png + 0.0.0-alpha.0+dev net6.0 enable diff --git a/sdk/dotnet/pulumi-plugin.json b/sdk/dotnet/pulumi-plugin.json index 13b579eb6..8a472b73f 100644 --- a/sdk/dotnet/pulumi-plugin.json +++ b/sdk/dotnet/pulumi-plugin.json @@ -1,5 +1,6 @@ { "resource": true, "name": "equinix", + "version": "0.0.0-alpha.0+dev", "server": "github://api.github.com/equinix" } diff --git a/sdk/go/equinix/internal/pulumiUtilities.go b/sdk/go/equinix/internal/pulumiUtilities.go index 3d5aaeb0f..df58d3576 100644 --- a/sdk/go/equinix/internal/pulumiUtilities.go +++ b/sdk/go/equinix/internal/pulumiUtilities.go @@ -162,7 +162,7 @@ func callPlainInner( func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { defaults := []pulumi.ResourceOption{} defaults = append(defaults, pulumi.PluginDownloadURL("github://api.github.com/equinix")) - version := SdkVersion + version := semver.MustParse("0.0.0-alpha.0+dev") if !version.Equals(semver.Version{}) { defaults = append(defaults, pulumi.Version(version.String())) } @@ -173,7 +173,7 @@ func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOptio func PkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { defaults := []pulumi.InvokeOption{} defaults = append(defaults, pulumi.PluginDownloadURL("github://api.github.com/equinix")) - version := SdkVersion + version := semver.MustParse("0.0.0-alpha.0+dev") if !version.Equals(semver.Version{}) { defaults = append(defaults, pulumi.Version(version.String())) } diff --git a/sdk/go/equinix/pulumi-plugin.json b/sdk/go/equinix/pulumi-plugin.json index 13b579eb6..8a472b73f 100644 --- a/sdk/go/equinix/pulumi-plugin.json +++ b/sdk/go/equinix/pulumi-plugin.json @@ -1,5 +1,6 @@ { "resource": true, "name": "equinix", + "version": "0.0.0-alpha.0+dev", "server": "github://api.github.com/equinix" } diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json index 5e3b3fd4e..dc4dc91dd 100644 --- a/sdk/nodejs/package.json +++ b/sdk/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@equinix-labs/pulumi-equinix", - "version": "${VERSION}", + "version": "0.0.0-alpha.0+dev", "description": "A Pulumi package for creating and managing equinix cloud resources.", "keywords": [ "pulumi", @@ -24,6 +24,7 @@ "pulumi": { "resource": true, "name": "equinix", + "version": "0.0.0-alpha.0+dev", "server": "github://api.github.com/equinix" } } diff --git a/sdk/python/pulumi_equinix/pulumi-plugin.json b/sdk/python/pulumi_equinix/pulumi-plugin.json index 13b579eb6..8a472b73f 100644 --- a/sdk/python/pulumi_equinix/pulumi-plugin.json +++ b/sdk/python/pulumi_equinix/pulumi-plugin.json @@ -1,5 +1,6 @@ { "resource": true, "name": "equinix", + "version": "0.0.0-alpha.0+dev", "server": "github://api.github.com/equinix" } diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml new file mode 100644 index 000000000..67582de4f --- /dev/null +++ b/sdk/python/pyproject.toml @@ -0,0 +1,22 @@ +[project] + name = "pulumi_equinix" + description = "A Pulumi package for creating and managing equinix cloud resources." + dependencies = ["packaging>=24.0", "pulumi>=3.0.0,<4.0.0", "semver>=2.8.1", "typing-extensions>=4.11,<5; python_version < \"3.11\""] + keywords = ["pulumi", "equinix", "category/cloud"] + readme = "README.md" + requires-python = ">=3.9" + version = "0.0.0a0+dev" + [project.license] + text = "Apache-2.0" + [project.urls] + Homepage = "https://deploy.equinix.com/" + Repository = "https://github.com/equinix/pulumi-equinix" + +[build-system] + requires = ["setuptools>=61.0"] + build-backend = "setuptools.build_meta" + +[tool] + [tool.setuptools] + [tool.setuptools.package-data] + pulumi_equinix = ["py.typed", "pulumi-plugin.json"] diff --git a/sdk/python/setup.py b/sdk/python/setup.py deleted file mode 100644 index 34981e5a8..000000000 --- a/sdk/python/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by pulumi-language-python. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import builtins as _builtins -import errno -from setuptools import setup, find_packages -from setuptools.command.install import install -from subprocess import check_call - - -VERSION = "0.0.0" -def readme(): - try: - with open('README.md', encoding='utf-8') as f: - return f.read() - except FileNotFoundError: - return "equinix Pulumi Package - Development Version" - - -setup(name='pulumi_equinix', - python_requires='>=3.9', - version=VERSION, - description="A Pulumi package for creating and managing equinix cloud resources.", - long_description=readme(), - long_description_content_type='text/markdown', - keywords='pulumi equinix category/cloud', - url='https://deploy.equinix.com/', - project_urls={ - 'Repository': 'https://github.com/equinix/pulumi-equinix' - }, - license='Apache-2.0', - packages=find_packages(), - package_data={ - 'pulumi_equinix': [ - 'py.typed', - 'pulumi-plugin.json', - ] - }, - install_requires=[ - 'packaging>=24.0', - 'pulumi>=3.0.0,<4.0.0', - 'semver>=2.8.1', - 'typing-extensions>=4.11,<5; python_version < "3.11"' - ], - zip_safe=False)