Skip to content

Reject tables inserted into inline tables#532

Open
gaoflow wants to merge 1 commit into
python-poetry:masterfrom
gaoflow:fix-531-reject-table-in-inline-table
Open

Reject tables inserted into inline tables#532
gaoflow wants to merge 1 commit into
python-poetry:masterfrom
gaoflow:fix-531-reject-table-in-inline-table

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject Table values appended or assigned to an InlineTable instead of serializing invalid TOML
  • Add a regression test for the public append() and item assignment paths
  • Update the unreleased changelog

Closes #531

Tests

  • uv run --no-project --with pytest --with pyyaml python -m pytest tests/test_items.py::test_append_table_to_inline_table_raises -q
  • uv run --no-project --with pytest --with pyyaml python -m pytest tests/test_items.py tests/test_api.py -q
  • uv run --no-project --with pytest --with pyyaml python -m pytest -q
  • uv run --no-project --with ruff ruff check tomlkit tests --exclude tests/toml-test
  • uv run --no-project --with ruff ruff format --check tomlkit tests --exclude tests/toml-test
  • git diff --check

Notes: full ruff check . / ruff format --check . include the initialized tests/toml-test submodule and fail on its upstream gen.py. mypy tomlkit tests --exclude tests/toml-test currently reports existing strict typing errors on master (for example source.py generic annotations and numeric dunder return types in items.py).

AI assistance was used under my direction.

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.

Nesting a Table inside an InlineTable is accepted

1 participant