klen / pylama

Code audit tool for python.
MIT License
1.05k stars 99 forks source link

Package toml is not being recognized as a requirement for pylama #236

Open vinibiavatti1 opened 1 year ago

vinibiavatti1 commented 1 year ago

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.

vinibiavatti1 commented 1 year ago

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.