Skip to content

TOML parse error: Invalid table header: Duplicate key version #1894

@hugovk

Description

@hugovk

Run ruff . with this pyproject.toml in an empty directory:

# pyproject.toml

[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

Outputs error only without --isolated in newest 0.0.222:

$ ruff --version
ruff 0.0.222
$  ruff .
error TOML parse error at line 6, column 1
  |
6 | [tool.hatch.version.raw-options]
  | ^
Invalid table header
Duplicate key `version`

$ ruff . --isolated
warning: No Python files found under the given path(s)

This file is parsed fine by other tools, such as Hatchling, python-build, Black, isort etc. Fuller version at https://github.com/hugovk/norwegianblue/

Error both with and without --isolated in 0.0.219:

$ ruff --version
ruff 0.0.219
$ ruff .
error TOML parse error at line 6, column 1
  |
6 | [tool.hatch.version.raw-options]
  | ^
Invalid table header
Duplicate key `version`

$ ruff . --isolated
error TOML parse error at line 6, column 1
  |
6 | [tool.hatch.version.raw-options]
  | ^
Invalid table header
Duplicate key `version`

Error only without --isolated in 0.0.220:

$ ruff --version
ruff 0.0.220
$ ruff .
error TOML parse error at line 6, column 1
  |
6 | [tool.hatch.version.raw-options]
  | ^
Invalid table header
Duplicate key `version`

$ ruff . --isolated
warning: No Python files found under the given path(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions