Conversation
Three packages import modules they never declare. All three resolve
transitively today, so nothing is broken right now, but each works only
by accident of what another dependency happens to pull in:
- metrix imports yaml (profiler/rocprof_wrapper.py, backends/base.py);
PyYAML arrives via fastmcp -> jsonschema-path
- rocm_mcp imports pydantic in four modules, via fastmcp
- uprof_mcp imports pydantic in one module, via fastmcp
Any of these breaks if fastmcp changes its dependency tree.
metrix also carried both a setup.py and a pyproject.toml. Modern pip uses
the PEP 517 backend for regular and editable installs alike, so setup.py is
never executed and the file is simply dead. Older pip and setuptools do run
setup.py develop, and that copy declares neither fastmcp nor pyyaml, omits
the metrix-mcp console script, and sets no package-data, so gpu_query.hip
would not ship and device_info._find_hip_source() would return None.
setup.py sets no field that pyproject does not already set, despite its
comment claiming otherwise, and nothing in the repo references it. Removing
it leaves one source of truth and matches the other six packages.
Co-Authored-By: Claude <noreply@anthropic.com>
Removing it drops the legacy Author field from the installed metadata: with setup.py Author: Muhammad Awad without Author: Everything else is unchanged -- Summary, Home-page, Author-email, License and Requires are identical, and editable, non-editable and wheel installs all import, expose both console scripts and resolve dependencies either way. PEP 621 authors entries that carry both a name and an email map to Author-email, not Author, so pyproject.toml alone cannot populate it. The dependency declarations this PR adds are unaffected and stay. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three packages import modules they never declare, and
metrixcarries a deadsetup.py.Undeclared dependencies
metrixyaml—profiler/rocprof_wrapper.py:12,backends/base.pyrocm_mcppydantic—from pydantic import Field×4 modulesuprof_mcppydantic— ×1 moduleAll three resolve transitively today. Each works only by accident of another package's dependency tree, and breaks if fastmcp ever drops or vendors them. Declaring what you import costs three lines and removes the coupling.
Removing
metrix/setup.pymetrixwas the only package with both asetup.pyand apyproject.toml; the other six are pyproject-only.Modern pip uses the PEP 517 backend for both regular and editable installs, so
setup.pyis never executed:Older pip/setuptools does take the legacy path — reproduced with a container's system pip via
pip install -e, which printsRunning setup.py develop for metrix. On that pathsetup.pyis authoritative, and it is missing four things pyproject declares:fastmcpdependencymetrix-mcpconsole script (it declares onlymetrix)[tool.setuptools.package-data] "metrix.backends" = ["*.hip"], sogpu_query.hipwould not ship anddevice_info._find_hip_source()would returnNonepyyaml, once addedSo the file is dead on current pip and wrong on old pip. Keeping the two configs in sync buys nothing, which is why this deletes rather than patches.
Its comment claims it exists "for legacy metadata fields that don't map directly from pyproject.toml's modern PEP 621 format," but every field it sets is already in pyproject, and nothing in the repo references the file (
grepacross*.sh,*.yml,*.toml,*.cfg,*.md→ no hits).Test plan
Unpatched
mainwas run first in every case, as a control — so the check is known to be capable of showing a difference before any conclusion is drawn from it.Declared metadata, bare
python:3.14, fresh venv per arm,cd /before probing, pip exit codes asserted rather than grepped:metrixfastmcp, pandasfastmcp, pandas,pyyamlrocm-mcpamdsmi, beautifulsoup4, fastmcp, httpxpydanticuprof-mcpfastmcppydanticRuntime behaviour, independently on
rocm/dev-ubuntu-22.04:7.0.2-complete: imports ofmetrix.backends.base,metrix.mcp.server,rocm_mcp.*,uprof_mcp.*, both console scripts, and packagedgpu_query.hip— all OK before, all OK after, identical line for line.All three packages install with exit 0 after the change,
metrix/setup.pyis confirmed absent from the built tree, andruff checkis clean.🤖 Generated with Claude Code