Skip to content

fix(build): correct module-name type in pyproject.toml files#2358

Open
60ke wants to merge 1 commit into
MoonshotAI:mainfrom
60ke:fix-module-name-type
Open

fix(build): correct module-name type in pyproject.toml files#2358
60ke wants to merge 1 commit into
MoonshotAI:mainfrom
60ke:fix-module-name-type

Conversation

@60ke
Copy link
Copy Markdown

@60ke 60ke commented May 24, 2026

Summary

The module-name field in [tool.uv.build-backend] should use string syntax for these single-module packages.

Regression History

This is a regression for the root package configuration:

  • Commit b75c9973 (2025-11-17) fixed the root pyproject.toml by changing module-name = ["kimi_cli"] to module-name = "kimi_cli".
  • Commit d2dfc94c (chore(dep): move kaos package to separate repo) later changed the root configuration back to module-name = ["kimi_cli"] while removing kaos from the same list.

The workspace package files have the same invalid single-module list syntax, so this PR corrects all affected uv_build package configs together.

Problem

The incorrect list syntax causes uv run to fail with:

TOML parse error at line 57, column 15
   |
57 | module-name = ["kimi_cli"]
   |               ^^^^^^^^^^^^
invalid type: sequence, expected a string

Root Cause

According to the uv build backend settings documentation:

  • Single module packages should use string syntax, for example module-name = "sklearn".
  • List syntax, for example module-name = ["foo", "bar"], is for namespace packages with multiple modules.

These packages each expose a single root module, so they should use string format.

Changes

File Before After
pyproject.toml module-name = ["kimi_cli"] module-name = "kimi_cli"
packages/kaos/pyproject.toml module-name = ["kaos"] module-name = "kaos"
packages/kimi-code/pyproject.toml module-name = ["kimi_code"] module-name = "kimi_code"
packages/kosong/pyproject.toml module-name = ["kosong"] module-name = "kosong"
sdks/kimi-sdk/pyproject.toml module-name = ["kimi_sdk"] module-name = "kimi_sdk"

Test Plan

  • uv run python -c "print('works')"
  • uv sync
  • uv build

The module-name field in [tool.uv.build-backend] should be a string for
single-module projects, not a list.

This is a regression bug:
- Commit b75c997 (2025-11-17) fixed this issue by changing
  module-name = ["kimi_cli"] to module-name = "kimi_cli"
- Commit d2dfc94 (chore(dep): move kaos package to separate repo)
  accidentally reverted this fix back to the list syntax

The incorrect list syntax causes uv run to fail with:
  TOML parse error: invalid type: sequence, expected a string

According to uv documentation, single-module projects should use string
format, while list format is only for namespace packages with multiple
root modules.

Affected files:
- pyproject.toml (kimi_cli)
- packages/kaos/pyproject.toml (kaos)
- packages/kimi-code/pyproject.toml (kimi_code)
- packages/kosong/pyproject.toml (kosong)
- sdks/kimi-sdk/pyproject.toml (kimi_sdk)
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

1 participant