diff --git a/Makefile b/Makefile index 15f96dce9..93a2cbca2 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/provider/cmd/pulumi-gen-eks/main.go b/provider/cmd/pulumi-gen-eks/main.go index fcf2876f1..c87981140 100644 --- a/provider/cmd/pulumi-gen-eks/main.go +++ b/provider/cmd/pulumi-gen-eks/main.go @@ -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, diff --git a/provider/cmd/pulumi-resource-eks/schema.json b/provider/cmd/pulumi-resource-eks/schema.json index 6c6686713..464627074 100644 --- a/provider/cmd/pulumi-resource-eks/schema.json +++ b/provider/cmd/pulumi-resource-eks/schema.json @@ -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", diff --git a/scripts/publish_packages.sh b/scripts/publish_packages.sh index 40f10fef3..5e5ac2b3c 100755 --- a/scripts/publish_packages.sh +++ b/scripts/publish_packages.sh @@ -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 diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml new file mode 100644 index 000000000..3d311ec74 --- /dev/null +++ b/sdk/python/pyproject.toml @@ -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"] diff --git a/sdk/python/setup.py b/sdk/python/setup.py deleted file mode 100644 index 13bf302f3..000000000 --- a/sdk/python/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by pulumi-gen-eks. *** -# *** 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 "eks Pulumi Package - Development Version" - - -setup(name='pulumi_eks', - python_requires='>=3.7', - version=VERSION, - description="Pulumi Amazon Web Services (AWS) EKS Components.", - long_description=readme(), - long_description_content_type='text/markdown', - keywords='pulumi aws eks', - url='https://pulumi.com', - project_urls={ - 'Repository': 'https://github.com/pulumi/pulumi-eks' - }, - license='Apache-2.0', - packages=find_packages(), - package_data={ - 'pulumi_eks': [ - 'py.typed', - 'pulumi-plugin.json', - ] - }, - install_requires=[ - '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' - ], - zip_safe=False)