klen / pylama

Code audit tool for python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Package toml is not being recognized as a requirement for pylama

vinibiavatti1 opened this issue · comments

Error
The library is not reading the project's pyproject.toml file. Even running the command pylama -o pyproject.toml, the below error occurs: (thanks @alorence for the stacktrace).

File "main.py", line 100, in shell
    options = parse_options(args)
  File "main.py", line 203, in parse_options
    cfg = get_config(options.options, rootdir=rootdir)
  File "main.py", line 272, in get_config
    return get_config_toml(cfg_path)
  File "main.py", line 290, in get_config_toml
    config = config_toml.Namespace()
NameError: name 'config_toml' is not defined. Did you mean: 'get_config_toml'?

Cause
It happens because the module config_toml cannot be imported at config module, due to an ImportError raised when the module toml tried to be imported. For some reason, when installing the library pip install pylama, the toml library is not being recognized as a required package for the project.

Fix (work-arround)
We can install toml library manually to fix the problem using the command pip install toml.

Looking at the documentation, I saw that it is proposital to consider toml library as a optional library. To install the library, the documentation suggests to perform pip install pylama[toml]. The issue can be closed.