From 2311e0458bfe47a9f9a681c5e1da5dc0dedd7129 Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Wed, 13 Nov 2024 08:41:31 -0800 Subject: [PATCH] Populate more metadata in compiler and runtime Python packages. (#19118) This will add more content to https://pypi.org/project/iree-base-compiler/ and https://pypi.org/project/iree-base-runtime/. We can also add more text to the README files or use the repository root README instead. Docs I followed: * https://packaging.python.org/en/latest/specifications/core-metadata/ * https://packaging.python.org/en/latest/specifications/well-known-project-urls/#well-known-project-urls --- .../bindings/python/iree/compiler/README.md | 3 +++ compiler/setup.py | 24 +++++++++++++++++-- runtime/setup.py | 6 ++++- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 compiler/bindings/python/iree/compiler/README.md diff --git a/compiler/bindings/python/iree/compiler/README.md b/compiler/bindings/python/iree/compiler/README.md new file mode 100644 index 000000000000..409ddbb94a54 --- /dev/null +++ b/compiler/bindings/python/iree/compiler/README.md @@ -0,0 +1,3 @@ +# IREE Python Compiler API + +This package provides an API for compiling IREE binaries from common input formats. diff --git a/compiler/setup.py b/compiler/setup.py index 63f296f9ee7f..e37ff8aa8214 100644 --- a/compiler/setup.py +++ b/compiler/setup.py @@ -414,6 +414,20 @@ def find_git_submodule_revision(submodule_path): ) print(f"Found compiler packages: {packages}") +with open( + os.path.join( + IREE_SOURCE_DIR, + "compiler", + "bindings", + "python", + "iree", + "compiler", + "README.md", + ), + "rt", +) as f: + README = f.read() + custom_package_suffix = os.getenv("IREE_COMPILER_CUSTOM_PACKAGE_SUFFIX", "") custom_package_prefix = os.getenv("IREE_COMPILER_CUSTOM_PACKAGE_PREFIX", "") @@ -422,8 +436,9 @@ def find_git_submodule_revision(submodule_path): version=f"{PACKAGE_VERSION}", author="IREE Authors", author_email="iree-technical-discussion@lists.lfaidata.foundation", - description="IREE Compiler API", - long_description="", + description="IREE Python Compiler API", + long_description=README, + long_description_content_type="text/markdown", license="Apache-2.0", classifiers=[ "Development Status :: 3 - Alpha", @@ -435,6 +450,11 @@ def find_git_submodule_revision(submodule_path): "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ], + project_urls={ + "homepage": "https://iree.dev/", + "repository": "https://github.com/iree-org/iree", + "documentation": "https://iree.dev/reference/bindings/python/", + }, ext_modules=[ CMakeExtension("iree.compiler._mlir_libs._mlir"), CMakeExtension("iree.compiler._mlir_libs._ireeDialects"), diff --git a/runtime/setup.py b/runtime/setup.py index 4621013ab561..e1a310148e46 100644 --- a/runtime/setup.py +++ b/runtime/setup.py @@ -539,7 +539,11 @@ def populate_built_package(abs_dir): "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ], - url="https://github.com/iree-org/iree", + project_urls={ + "homepage": "https://iree.dev/", + "repository": "https://github.com/iree-org/iree", + "documentation": "https://iree.dev/reference/bindings/python/", + }, python_requires=">=3.9", ext_modules=( [