diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7328dfa25..725b502cca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 7f16d32279..02c0951ad2 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d8b58dd9d..c51afde9be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 4b939e4bdc..cb126a435d 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ sdk/java/.gradle sdk/java/gradle sdk/java/gradlew sdk/java/gradlew.bat + +sdk/python/venv diff --git a/Makefile b/Makefile index cc664cb43d..646379a647 100644 --- a/Makefile +++ b/Makefile @@ -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} diff --git a/provider/cmd/pulumi-resource-google-native/schema.json b/provider/cmd/pulumi-resource-google-native/schema.json index 7a1ef96282..1500fb528c 100644 --- a/provider/cmd/pulumi-resource-google-native/schema.json +++ b/provider/cmd/pulumi-resource-google-native/schema.json @@ -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" diff --git a/provider/pkg/gen/schema.go b/provider/pkg/gen/schema.go index e66dc0e87d..9f3a2bd2bc 100644 --- a/provider/pkg/gen/schema.go +++ b/provider/pkg/gen/schema.go @@ -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{}{ diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml new file mode 100644 index 0000000000..78d5f95877 --- /dev/null +++ b/sdk/python/pyproject.toml @@ -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"] diff --git a/sdk/python/setup.py b/sdk/python/setup.py deleted file mode 100644 index a81e5829d0..0000000000 --- a/sdk/python/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi SDK Generator. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -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 "google-native Pulumi Package - Development Version" - - -setup(name='pulumi_google_native', - python_requires='>=3.7', - version=VERSION, - description="A native Pulumi package for creating and managing Google Cloud resources.", - long_description=readme(), - long_description_content_type='text/markdown', - keywords='pulumi google cloud category/cloud kind/native', - url='https://pulumi.com', - project_urls={ - 'Repository': 'https://github.com/pulumi/pulumi-google-native' - }, - license='Apache-2.0', - packages=find_packages(), - package_data={ - 'pulumi_google_native': [ - 'py.typed', - 'pulumi-plugin.json', - ] - }, - install_requires=[ - 'parver>=0.2.1', - 'pulumi>=3.0.0,<4.0.0', - 'semver>=2.8.1' - ], - zip_safe=False)