build: align perf_analyzer and genai-perf wheel metadata on PEP 639 (#469) - #470
Conversation
…469) Brings both packages in this repo to the same declarative, pinned hatchling build and Metadata-Version 2.4 metadata used by tritonserver, tritonfrontend, model_analyzer and triton_cli. perf_analyzer: - Migrates from an unbounded `setuptools>=42` to a pinned hatchling backend. - Declares license "BSD-3-Clause" + license-files; it previously declared no license at all. - Adds requires-python = ">=3.10". Without it hatchling tags the wheel py2.py3-none-any, wrongly advertising Python 2 support; with it the wheel keeps the py3-none-any tag setuptools produced. - Lists src/perf_analyzer/bin/perf_analyzer as a wheel artifact. That binary is generated by the CMake build and matched by the "bin/" rule in .gitignore, and hatchling's file selection is VCS-ignore aware, so without this it would be silently dropped from the wheel. genai-perf: - Replaces the deprecated `license = {text = "BSD"}` table with the SPDX expression "BSD-3-Clause" (the LICENSE file is BSD 3-Clause) and declares license-files, so METADATA carries License-Expression rather than free text. - Pins the previously unbounded hatchling requirement. Verified for both: Metadata-Version 2.4, License-Expression, License-File, unchanged wheel tags and entry points, the perf_analyzer binary present in the wheel, and twine check passing. Refs: TRI-1775 (cherry picked from commit ee519c6)
|
| [tool.hatch.build.targets.wheel] | ||
| packages = ["src/perf_analyzer"] | ||
| # bin/perf_analyzer is produced by the CMake build and matched by the | ||
| # "bin/" rule in .gitignore. Hatchling's file selection is VCS-ignore | ||
| # aware, so without listing it as an artifact the compiled binary would | ||
| # be silently dropped from the wheel. See TRI-1775. | ||
| artifacts = ["src/perf_analyzer/bin/perf_analyzer"] |
There was a problem hiding this comment.
This build-backend migration changes package discovery and relies on Hatchling-specific artifact handling for the executable, but no test builds and inspects the resulting perf-analyzer wheel. The installed wrapper requires perf_analyzer/bin/perf_analyzer at runtime, so add a wheel-content smoke test that verifies the version, entry point, and executable. Without one, future packaging changes could silently ship an unusable CLI.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
What does the PR do?
Cherry-pick of #469 onto
r26.09. Applied cleanly, no conflicts.license-files.requires-python(without it hatchling tags the wheelpy2.py3-none-any).bin/perf_analyzeras a wheel artifact — it is matched by.gitignore, and hatchling file selection is VCS-ignore aware, so it would otherwise be silently dropped.Related Issues: