Skip to content

build: align perf_analyzer and genai-perf wheel metadata on PEP 639 (#469) - #470

Merged
mc-nv merged 1 commit into
r26.09from
mchornyi/TRI-1775/cherry-pick-r26.09
Sep 16, 2026
Merged

mc-nv merged 1 commit into
r26.09from
mchornyi/TRI-1775/cherry-pick-r26.09

Conversation

@mc-nv

@mc-nv mc-nv commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What does the PR do?

Cherry-pick of #469 onto r26.09. Applied cleanly, no conflicts.

  • Pins hatchling for both packages; declares SPDX license + license-files.
  • Adds requires-python (without it hatchling tags the wheel py2.py3-none-any).
  • Lists the CMake-built bin/perf_analyzer as 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:

  • Resolves: TRI-1775

…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)
@mc-nv mc-nv self-assigned this Sep 15, 2026
@mc-nv mc-nv added build Build system or external dependencies (build: PRs) cherry-pick Cherry-picked from another branch labels Sep 15, 2026
@mc-nv
mc-nv marked this pull request as ready for review September 15, 2026 23:56
@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking recommendation to add automated coverage for the migrated perf-analyzer wheel.

Findings

  1. P2 Wheel Contract Lacks Coverage

Summary

This PR aligns both Python packages with PEP 639 metadata and pins their Hatchling build backend. It also migrates perf-analyzer from setuptools to Hatchling, declares Python 3.10+, and explicitly includes the CMake-generated executable in its wheel.

  • Adds SPDX license expressions and license-file metadata to both packages.
  • Migrates perf-analyzer package/version discovery to Hatchling.
  • Preserves the ignored native executable through an explicit wheel artifact declaration.
  • The new perf-analyzer wheel contract is not covered by an automated wheel-content test.

Reviews (1) · Last reviewed commit: "build: align perf_analyzer and genai-per..."

Comment thread pyproject.toml
Comment on lines +45 to +51
[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"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Wheel Contract Lacks Coverage

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!

@mc-nv
mc-nv merged commit 3208a75 into r26.09 Sep 16, 2026
4 of 6 checks passed
@mc-nv
mc-nv deleted the mchornyi/TRI-1775/cherry-pick-r26.09 branch September 16, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system or external dependencies (build: PRs) cherry-pick Cherry-picked from another branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants