Skip to content

codespell has issues when pyproject.toml includes multiple sections of [[tool.uv.index]] #3852

Description

@jhoelzl

Issue

codespell fails to parse pyproject.toml with TOML array of tables syntax [[...]] (e.g. multiple sections of [[tool.uv.index]]) and throws an error indicating the section "already exists".

Using latest codespell release 2.4.1.

Steps to Reproduce

  1. Create a pyproject.toml with multiple entries using TOML array of tables syntax, for example:
[[tool.uv.index]]
name = "custom-index"
url = "https://example.com/simple/"
explicit = true

[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"
  1. Run codespell

Expected Behavior

codespell should correctly parse the TOML array of tables syntax [[...]] as defined in the [TOML specification]. Multiple [[section]] entries are valid TOML and represent an array of tables.

This syntax is commonly used by modern Python tooling like [uv] for defining multiple package indexes. The TOML file is valid and works correctly with other tools (uv, pip, ruff, etc.).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions