Skip to content

build: migrate model_analyzer to hatchling and pin the build backend (#1038) - #1039

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 #1038 onto r26.09. Applied cleanly, no conflicts.

  • The PEP 639 SPDX license string already here is rejected by setuptools <77, but the backend was an unbounded setuptools >= 61.0 — so builds only worked by luck of the environment.
  • Pins hatchling and restores explicit sdist boundaries.

Related Issues:

  • Resolves: TRI-1775

…1038)

* build: migrate model_analyzer to hatchling and pin the build backend

The PEP 639 SPDX `license = "Apache-2.0"` string already declared here is
rejected outright by setuptools < 77 ("project.license must be valid
exactly by one definition"), but the build backend was declared as an
unbounded `setuptools >= 61.0`. The build therefore only succeeded when
the environment happened to provide a new enough setuptools -- the same
class of environment-dependent wheel metadata bug tracked in TRI-1775,
in the opposite direction.

Switches to a pinned hatchling backend, aligning with tritonserver,
tritonfrontend, genai-perf and triton_cli, and declares license-files
explicitly rather than relying on implicit discovery.

Verified: Metadata-Version 2.4, License-Expression: Apache-2.0,
License-File: LICENSE, the model-analyzer console script is preserved,
and twine check passes.

Refs: TRI-1775

* fix: restore sdist package boundaries for model_analyzer

Only the wheel target declared a package-selection policy, so the sdist
fell back to hatchling's default file selection and shipped tracked
content the previous setuptools configuration kept out. An explicit
sdist target with only-include restores the intended boundaries;
only-include rather than include because the latter is additive and
still let docs/ through.

Verified: the sdist now carries model_analyzer, VERSION, LICENSE,
README.md and pyproject.toml, and the wheel is unchanged at the same 198
module files as the setuptools build.

Refs: TRI-1775
(cherry picked from commit 5eab1ef)
@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: 5/5

The PR appears safe to merge; no concrete packaging, compatibility, or security regressions were identified.

Summary

This PR replaces the environment-dependent setuptools build backend with pinned Hatchling configuration while preserving package discovery, dynamic versioning, licensing metadata, and explicit source-distribution boundaries.

  • Pins Hatchling 1.27.0 as the PEP 517 backend.
  • Reads the package version from VERSION.
  • Explicitly configures wheel and sdist contents.
  • Adds PEP 639 license-file metadata.

Reviews (1) · Last reviewed commit: "build: migrate model_analyzer to hatchli..."

@mc-nv
mc-nv merged commit ef3291d into r26.09 Sep 16, 2026
4 of 5 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

Development

Successfully merging this pull request may close these issues.

2 participants