[BUG] toml support is incomplete
prospector fails with stack trace and error like the following in the presence of valid pyproject.toml files.
toml.decoder.TomlDecodeError: Not a homogeneous array (line 152 column 1 char 4093)
To Reproduce
- add a line to your pyproject.toml like
foo = ["bar", { "baz" = "qux}] - Call prospector
- See error
Expected behavior No error
Additional context
The issue here is that prospector uses the toml library which doesn't support the current toml standard.
The solution is to replace toml with tomli, which is part of the python standard library from 3.11.
I'd be happy to create a PR for this if you agree.
Turns out I'm not this first to notice this, this PR in requirements-detector is already there to address the root cause.
Incidentally it looks like the dependency on toml in this package is redundant.
Also FYI when I setup out this project locally 4 tests were failing out of the box (python 3.10.4 on macOS):
FAILED tests/execution/test_execution.py::test_total_errors - assert 6 == 5
FAILED tests/profiles/test_profile.py::TestProfileInheritance::test_module_file_inheritance - prospector.profiles.exceptions.ProfileNotFound
FAILED tests/profiles/test_profile.py::TestProfileInheritance::test_module_inheritance - prospector.profiles.exceptions.ProfileNotFound
FAILED tests/tools/pylint/test_pylint_tool.py::TestPylintTool::test_wont_throw_false_positive_relative_beyond_top_level - AssertionError: Lists differ: [pylint-django-not-available] != []