robotframework-tidy icon indicating copy to clipboard operation
robotframework-tidy copied to clipboard

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

Open mikeleppane opened this issue 1 year ago • 7 comments

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.

mikeleppane avatar Sep 12 '24 09:09 mikeleppane

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).

bhirsz avatar Sep 12 '24 09:09 bhirsz

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 avatar Sep 12 '24 09:09 mikeleppane

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

mikeleppane avatar Sep 12 '24 09:09 mikeleppane

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.

bhirsz avatar Sep 12 '24 10:09 bhirsz

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

configure = [
    "GenerateDocumentation:enabled=False"
]

mikeleppane avatar Sep 12 '24 10:09 mikeleppane

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

bhirsz avatar Sep 12 '24 10:09 bhirsz

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

mikeleppane avatar Sep 12 '24 13:09 mikeleppane