Infer Python version from repository pyproject.toml for dev versions#18838
Merged
harupy merged 1 commit intomlflow:masterfrom Nov 14, 2025
Merged
Infer Python version from repository pyproject.toml for dev versions#18838harupy merged 1 commit intomlflow:masterfrom
harupy merged 1 commit intomlflow:masterfrom
Conversation
This change enables automatic Python version inference for dev versions by fetching and parsing the requires-python field from the package repository's pyproject.toml file. Previously, dev versions would fall back to a hardcoded default Python version (3.10). Now, the script fetches the actual requires-python specification from the repository and selects the minimum compatible Python version from the candidates. Changes: - Added repo field to ml-package-versions.yml for 30 packages with install_dev - Enhanced set_matrix.py to fetch pyproject.toml from GitHub repositories - Added logging to stderr for better debugging of Python version inference 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
harupy
commented
Nov 14, 2025
|
|
||
| pytorch: | ||
| package_info: | ||
| repo: https://github.com/pytorch/pytorch/tree/HEAD |
Member
Author
There was a problem hiding this comment.
Use HEAD to avoid using master/main
harupy
commented
Nov 14, 2025
| resp = requests.get(raw_url, timeout=10) | ||
| resp.raise_for_status() | ||
| except requests.HTTPError as e: | ||
| if e.response.status_code == 404: |
Member
Author
There was a problem hiding this comment.
pyproject.toml might not exist. Handle 404.
Contributor
|
Documentation preview for 29fa3bc is available at: More info
|
harupy
commented
Nov 14, 2025
|
|
||
|
|
||
| def infer_python_version(package: str, version: str) -> str: | ||
| def _requires_python_from_repo(repo_url: str) -> str | None: |
Member
Author
There was a problem hiding this comment.
Confirmed the right python version is inferred (3.11 for sklearn: scikit-learn/scikit-learn#32646):
jackiehimel
pushed a commit
to jackiehimel/mlflow
that referenced
this pull request
Nov 21, 2025
…lflow#18838) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Jackie Himel <jacqueline.himel@vanderbilt.edu>
mprahl
pushed a commit
to opendatahub-io/mlflow
that referenced
this pull request
Nov 21, 2025
…lflow#18838) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Tian-Sky-Lan
pushed a commit
to Tian-Sky-Lan/mlflow
that referenced
this pull request
Nov 24, 2025
…lflow#18838) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Tian Lan <sky.blue266000@gmail.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.
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
What changes are proposed in this pull request?
This PR enables automatic Python version inference for dev versions by fetching and parsing the
requires-pythonfield from the package repository'spyproject.toml.Previously, dev versions would fall back to a hardcoded default Python version (3.10). Now, the script fetches the actual
requires-pythonspecification from the repository and selects the minimum compatible Python version.Changes:
repofield toml-package-versions.ymlfor 30 packages withinstall_devset_matrix.pyto fetchpyproject.tomlfrom GitHub repositoriesExample: sklearn dev version now correctly uses Python 3.11 (matching
requires-python = ">=3.11"in their repo)How is this PR tested?
Manually tested with:
Verified that sklearn dev version uses Python 3.11 and langchain (monorepo) correctly fetches from subdirectory.
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
How should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionShould this PR be included in the next patch release?
🤖 Generated with Claude Code