Skip to content

Include git submodule contents in Python package build#20394

Merged
harupy merged 2 commits intomasterfrom
copilot/fix-git-submodule-inclusion
Jan 28, 2026
Merged

Include git submodule contents in Python package build#20394
harupy merged 2 commits intomasterfrom
copilot/fix-git-submodule-inclusion

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

What changes are proposed in this pull request?

Git submodules are not automatically detected by Python build tools. The mlflow/assistant/skills submodule contains skill files (markdown documentation, Python scripts) that were missing from distributed packages.

Changes:

  • Added "assistant/skills/**/*" to package data configuration in dev/pyproject.py
  • Regenerated pyproject.toml and pyproject.release.toml with the updated pattern

Verification:
The wheel now includes all 22 files from the submodule (LICENSE, README, skill documentation, evaluation scripts, and utilities).

How is this PR tested?

  • Manual tests

Built the package and verified submodule contents are present:

uv run python dev/build.py
unzip -l dist/mlflow-*.whl | grep "assistant/skills"  # Shows 22 files

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Fixed missing mlflow/assistant/skills submodule files in distributed packages. Users installing MLflow from PyPI will now have access to assistant skill functionality.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/build: Build and test infrastructure for MLflow

How should the PR be classified in the release notes? Choose one:

  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)
Original prompt

Include git submodule contents in Python package build

Summary

The mlflow/assistant/skills git submodule was not being included in the Python package when running python -m build or dev/build.py. This needs to be fixed by adding the submodule path to the package-data configuration.

Problem

Git submodules are not automatically detected by Python build tools. The mlflow/assistant/skills submodule contains skill files (markdown, Python scripts) that need to be distributed with the package.

Solution

Update dev/pyproject.py to include "assistant/skills/**/*" in the _get_package_data() function. This file auto-generates pyproject.toml and pyproject.release.toml.

Changes Required

In dev/pyproject.py, modify the _get_package_data function around line 455-474:

def _get_package_data(package_type: PackageType) -> dict[str, list[str]] | None:
    if package_type == PackageType.TRACING:
        return None

    package_data = {
        "mlflow": [
            "store/db_migrations/alembic.ini",
            "temporary_db_migrations_for_pre_1_users/alembic.ini",
            "pyspark/ml/log_model_allowlist.txt",
            "server/auth/basic_auth.ini",
            "server/auth/db/migrations/alembic.ini",
            "models/notebook_resources/**/*",
            "ai_commands/**/*.md",
            "assistant/skills/**/*",  # ADD THIS LINE
        ]
    }

    if package_type != PackageType.SKINNY:
        package_data["mlflow"] += ["models/container/**/*", "server/js/build/**/*"]

    return package_data

After Making the Change

Run uv run python dev/pyproject.py to regenerate the pyproject.toml files.

Verification

After rebuilding with uv run python dev/build.py, verify the submodule is included:

unzip -l dist/mlflow-*.whl | grep "assistant/skills"

This should show ~22 files from the submodule.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copy link
Collaborator

@B-Step62 B-Step62 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copilot AI changed the title [WIP] Fix inclusion of git submodule in Python package build Include git submodule contents in Python package build Jan 28, 2026
Copilot AI requested a review from harupy January 28, 2026 05:13
@harupy harupy marked this pull request as ready for review January 28, 2026 05:19
Copilot AI review requested due to automatic review settings January 28, 2026 05:19
@github-actions github-actions bot added area/build Build and test infrastructure for MLflow rn/bug-fix Mention under Bug Fixes in Changelogs. labels Jan 28, 2026
Copy link
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 fixes missing mlflow/assistant/skills git submodule files in built/distributed Python packages by explicitly including them as setuptools package data.

Changes:

  • Added assistant/skills/**/* to tool.setuptools.package-data for the main MLflow package.
  • Regenerated pyproject.toml and pyproject.release.toml from dev/pyproject.py to include the new package-data entry.
  • Updated the skinny package’s generated libs/skinny/pyproject.toml to include the same skills package data.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dev/pyproject.py Adds the assistant/skills/**/* package-data glob in the generator so all derived pyproject files include the submodule contents.
pyproject.toml Includes the new skills glob in tool.setuptools.package-data for the main build.
pyproject.release.toml Includes the new skills glob for release builds.
libs/skinny/pyproject.toml Includes the new skills glob for the skinny package build.

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

@github-actions
Copy link
Contributor

Documentation preview for bc1b1d0 is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

@harupy harupy added this pull request to the merge queue Jan 28, 2026
Merged via the queue into master with commit c0339a8 Jan 28, 2026
82 of 98 checks passed
@harupy harupy deleted the copilot/fix-git-submodule-inclusion branch January 28, 2026 05:35
harupy added a commit to harupy/mlflow that referenced this pull request Jan 28, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
harupy added a commit to harupy/mlflow that referenced this pull request Jan 28, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
harupy added a commit that referenced this pull request Jan 28, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build and test infrastructure for MLflow rn/bug-fix Mention under Bug Fixes in Changelogs. v3.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants