Skip to content

fix: replace @iarna/toml with smol-toml for TOML 1.0 and PEP 735 support#208

Open
TALLEC-Scott wants to merge 1 commit intosourcegraph:scipfrom
TALLEC-Scott:fix/pep735-toml-parsing
Open

fix: replace @iarna/toml with smol-toml for TOML 1.0 and PEP 735 support#208
TALLEC-Scott wants to merge 1 commit intosourcegraph:scipfrom
TALLEC-Scott:fix/pep735-toml-parsing

Conversation

@TALLEC-Scott
Copy link

Fixes #207

Problem

@iarna/toml fails to parse mixed-type arrays (inline tables + strings) which is valid TOML 1.0 syntax used by PEP 735 dependency groups.

Error

[dependency-groups]
dev = [
{include-group = "test"}, # inline table
"ml_stack_document_extraction", # string
]

Results in:
TomlError: line 66, col 34
Config file "pyproject.toml" could not be parsed.

Solution

Replace @iarna/toml (unmaintained since 2019) with smol-toml - a modern, actively maintained TOML parser that correctly handles TOML 1.0 syntax.

Changes

  • Replace @iarna/toml with smol-toml in dependencies
  • Update imports and remove TOML.JsonMap type references

Testing

  • Build successful
  • All existing tests pass
  • Correctly parses pyproject.toml with PEP 735 syntax

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.

Fix parsing error for mixing inline tables with strings in the same array in pyproject.toml

1 participant