Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate more metadata in compiler and runtime Python packages. #19118

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/bindings/python/iree/compiler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# IREE Python Compiler API

This package provides an API for compiling IREE binaries from common input formats.
24 changes: 22 additions & 2 deletions compiler/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more lightweight solution could be to add readme = "README.md" to the pyproject.toml but as it only defines the build dependencies for this Python package, I would stick with what you got here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could work. Note that we have README files in two locations for the runtime package, and I'm matching that structure here for the compiler package:

Should probably make a pass through and clean up the files. Some were last updated halfway through code restructuring:

# IREE runtime
Note that this directory is in a transitional state. The C code still lives
in directories under `iree/` and will be relocated here in the future.
## Language Bindings
### Python

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like we might want to move https://github.com/iree-org/iree/blob/main/runtime/bindings/python/iree/runtime/README.md closer to https://github.com/iree-org/iree/tree/main/docs/api_docs/python (not merging it with the README.md there but moving into a newly to create _static folder).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting idea. I feel like API docs and a package README are a bit different though 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have confused myself and therefore it is not an interesting idea at all and rather wrong. I thought the README I was referring to was used for RTD but that is obviously not the case you mentioned it is used for PyPi. We should than probably fuse the two READMEs we have for the runtime?


custom_package_suffix = os.getenv("IREE_COMPILER_CUSTOM_PACKAGE_SUFFIX", "")
custom_package_prefix = os.getenv("IREE_COMPILER_CUSTOM_PACKAGE_PREFIX", "")

Expand All @@ -422,8 +436,9 @@ def find_git_submodule_revision(submodule_path):
version=f"{PACKAGE_VERSION}",
author="IREE Authors",
author_email="[email protected]",
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=[
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stellaraccident how do you feel about us changing the Development Status :: 3 - Alpha to 4 - Beta or 5 - Production/Stable?

https://pypi.org/classifiers/

Looks like iree-turbine is already 5 - Production/Stable 🤔
https://github.com/iree-org/iree-turbine/blob/3c6240a228543a80b109d61a0c0f521d40782164/setup.py#L90-L91

Others:

"Development Status :: 3 - Alpha",
Expand All @@ -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/",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered linking to https://iree-python-api.readthedocs.io/en/latest/ here, but we don't have a link from readthedocs back to iree.dev.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's go with iree.dev for now which at least links to rtd.

},
ext_modules=[
CMakeExtension("iree.compiler._mlir_libs._mlir"),
CMakeExtension("iree.compiler._mlir_libs._ireeDialects"),
Expand Down
6 changes: 5 additions & 1 deletion runtime/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
[
Expand Down
Loading