MarketSquare / robotframework-tidy

Robot Framework code formatter
https://robotidy.readthedocs.io/
Apache License 2.0
107 stars 16 forks source link

Importing transformer 'GenerateDocumentation' failed. Verify if correct name or configuration was provided. #715

Open mikeleppane opened 2 months ago

mikeleppane commented 2 months ago

Hey! I'm getting the following error when trying to run robotidy:

Error: Importing transformer 'GenerateDocumentation' failed. Verify if correct name or configuration was provided.

Versions:

robotidy, version 4.14.0

Robot Framework 7.0.1 (Python 3.11.6 on win32)

This has worked before, but I don't know why this now happens.

bhirsz commented 2 months ago

Do you use it with any specific config? GenerateDocumentation uses jinja so it could be also because of change in the depending library - I would need to check.

The error itself doesn't tell much, I will look into possiblity of printing whole error stack if used with --verbose flag (in the future).

mikeleppane commented 2 months ago

Yes we have some pre-defined config:

[tool.robotidy]
overwrite = true
skip-tags = true
spacecount = 4
configure = [
    "NormalizeTags:enabled=False",
]

From the lock file:

[[package]]
name = "jinja2"
version = "3.1.4"
mikeleppane commented 2 months ago

Is there a way to skip this transformer? So that we can circumvent this error?

bhirsz commented 2 months ago

GenerateDocumentation is 'opt in' kind of transformer, if you don't enable it you it shouldn't be included. I wasn't aware you don't use it in the configuration - if robotidy fails even without using it, it may be different issue. I will try to reproduce it.

mikeleppane commented 2 months ago

Yes, we don't use it. However, I tried explicitly disabling it in the config, but that did not help:

configure = [
    "GenerateDocumentation:enabled=False"
]
bhirsz commented 2 months ago

Can you try to install this version and run it again?

pip install https://github.com/MarketSquare/robotframework-tidy/archive/fix/generatedocumentation_import_error.zip

I only added bit more error logging as I can't reproduce it on my local setup

mikeleppane commented 2 months ago

Hmm, after reinstalling, it suddenly started working. I need to monitor this closely. I will reassess tomorrow.