Skip to content

fix(setup.py): accept FlyDSL dev/rc builds when version matches pinned release#2664

Open
guangzlu wants to merge 2 commits intoROCm:mainfrom
guangzlu:setup_fix
Open

fix(setup.py): accept FlyDSL dev/rc builds when version matches pinned release#2664
guangzlu wants to merge 2 commits intoROCm:mainfrom
guangzlu:setup_fix

Conversation

@guangzlu
Copy link
Copy Markdown
Contributor

@guangzlu guangzlu commented Apr 9, 2026

Problem
In develop mode, setup.py ensures FlyDSL matches the pinned version by:

Reading the installed version with importlib.metadata.version("flydsl").
Comparing it to the pinned string (0.1.2).
On any mismatch or import error, running pip install flydsl==0.1.2.
For an editable/local FlyDSL install, the reported version is often 0.1.2.dev462 (or similar), which is not equal to the string "0.1.2", so the script always took the “mismatch” path and invoked pip install. That is unnecessary and can break workflows where:

  • FlyDSL is installed from a git checkout (dev/local version), or
  • PyPI has no wheel for the current Python ABI (e.g. cp313 while wheels exist only for cp310/cp312).

Solution
Add _flydsl_matches_pinned(installed_ver, pinned_ver) that uses packaging.version.Version and compares the .release tuples (e.g. (0, 1, 2)), so 0.1.2, 0.1.2.dev462, and other suffixes on the same X.Y.Z are treated as matching the pin.
If packaging is not importable, fall back to the previous strict string comparison for safety.

@guangzlu guangzlu requested review from a team and Copilot April 9, 2026 08:19
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-355 Run Triton tests on MI355 in addition to MI325
ci:sglang SGLang integration tests
ci:atom ATOM benchmark (DeepSeek-R1 + GPT-OSS)
ci:vllm vLLM benchmark
ci:all All of the above

Add labels via the sidebar or gh pr edit 2664 --add-label <label>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the develop-mode FlyDSL version check in setup.py so that local/dev/rc builds of FlyDSL (e.g., 0.1.2.dev*) are treated as compatible with a pinned 0.1.2 release, avoiding unnecessary pip install flydsl==... during editable installs.

Changes:

  • Add _flydsl_matches_pinned() that compares parsed versions via packaging.version.Version.
  • Use the helper in the develop-mode FlyDSL validation logic and precompute the pinned version string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup.py
Comment on lines +56 to +61
"""Same X.Y.Z as pin, allowing dev/rc/post/local segments (e.g. 0.1.2.dev462 == 0.1.2)."""
try:
from packaging.version import Version
except ImportError:
return installed_ver == pinned_ver
return Version(installed_ver).release == Version(pinned_ver).release
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

_flydsl_matches_pinned() compares Version(...).release, which ignores the PEP 440 epoch. That means versions like 1!0.1.2 would be treated as matching a pinned 0.1.2, even though the epoch changes version semantics. Consider comparing Version(...).base_version (or (epoch, release)) instead, which still ignores dev/rc/post/local segments but preserves epoch correctness (similar normalization is used elsewhere in the repo).

Suggested change
"""Same X.Y.Z as pin, allowing dev/rc/post/local segments (e.g. 0.1.2.dev462 == 0.1.2)."""
try:
from packaging.version import Version
except ImportError:
return installed_ver == pinned_ver
return Version(installed_ver).release == Version(pinned_ver).release
"""Same pinned base version, allowing dev/rc/post/local segments while preserving epoch."""
try:
from packaging.version import Version
except ImportError:
return installed_ver == pinned_ver
return Version(installed_ver).base_version == Version(pinned_ver).base_version

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants