Skip to content

codespell unhappy with pytest config in pyproject.toml #2544

@aucampia

Description

@aucampia

When running codespell with this pyproject.toml I get the following error:

$ python -m poetry run codespell --version
2.2.2
$ python -m poetry run codespell
Traceback (most recent call last):
  File "/home/iwana/sw/d/github.com/aucampia/cookiecutter-python/.venv/bin/codespell", line 8, in <module>
    sys.exit(_script_main())
  File "/home/iwana/sw/d/github.com/aucampia/cookiecutter-python/.venv/lib/python3.10/site-packages/codespell_lib/_codespell.py", line 767, in _script_main
    return main(*sys.argv[1:])
  File "/home/iwana/sw/d/github.com/aucampia/cookiecutter-python/.venv/lib/python3.10/site-packages/codespell_lib/_codespell.py", line 772, in main
    options, parser = parse_options(args)
  File "/home/iwana/sw/d/github.com/aucampia/cookiecutter-python/.venv/lib/python3.10/site-packages/codespell_lib/_codespell.py", line 426, in parse_options
    config.read_dict(data)
  File "/usr/lib64/python3.10/configparser.py", line 755, in read_dict
    self.set(section, key, value)
  File "/usr/lib64/python3.10/configparser.py", line 1205, in set
    super().set(section, option, value)
  File "/usr/lib64/python3.10/configparser.py", line 895, in set
    value = self._interpolation.before_set(self, section, option,
  File "/usr/lib64/python3.10/configparser.py", line 402, in before_set
    raise ValueError("invalid interpolation syntax in %r at "
ValueError: invalid interpolation syntax in "{'testpaths': ['tests'], 'addopts': ['--cov-config=pyproject.toml', '--capture=no', '--tb=native', '-ra'], 'log_format': '%(asctime)s %(process)d %(thread)d %(levelno)03d:%(levelname)-8s %(name)-12s %(module)s:%(lineno)s:%(funcName)s %(message)s', 'log_date_format': '%Y-%m-%dT%H:%M:%S', 'log_cli_format': '%(asctime)s %(process)d %(thread)d %(levelno)03d:%(levelname)-8s %(name)-12s %(module)s:%(lineno)s:%(funcName)s %(message)s', 'log_cli_date_format': '%Y-%m-%dT%H:%M:%S'}" at position 123

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