Skip to content

[BUG] robotcode analyze code does not work with click<8.2 #568

@becarusys

Description

@becarusys

Describe the bug
Since robotcode 2.2.0 the analyze code feature crashes with click<8.2 with the error:
Error: progressbar() got an unexpected keyword argument 'hidden'

Steps To Reproduce
Create an empty test file and execute robotcode:

$ touch test.robot
$ uvx --with click~=8.2.0 robotcode[analyze]==2.2.0 analyze code test.robot 
Files: 1, Errors: 0, Warnings: 0, Infos: 0, Hints: 0 (in 0.01s)
# error with click<8.2
$ uvx --with click~=8.1.0 robotcode[analyze]==2.2.0 analyze code test.robot 
Error: progressbar() got an unexpected keyword argument 'hidden'
# error does not appear with robotcode 2.1.0
$ uvx --with click~=8.1.0 robotcode[analyze]==2.1.0 analyze code test.robot 
Files: 1, Errors: 0, Warnings: 0, Infos: 0, Hints: 0

Expected behavior
robotcode should require click>=8.2
When installing robotcode with click<8.2 the dependency resolution should fail.

Additional context
It appears as commit 1ac9247 introduced a new progressbar which requires click 8.2 (the hidden argument to be precise).

Currently robotcode-plugin depends on click>=8.1.0, but this does not seem to be enforced correctly either. Instead an older robotcode-plugin package is installed which is incompatible with robotcode-anaylze==2.2.0:

$ uv venv test
Using CPython 3.12.12 interpreter at: /usr/local/bin/python
Creating virtual environment at: test
Activate with: source test/bin/activate
$ source test/bin/activate
(test) $ uv pip install robotcode[analyze]==2.2.0 click==8.0.0
Using Python 3.12.12 environment at: test
Resolved 11 packages in 7ms
Installed 11 packages in 9ms
 + click==8.0.0
 + platformdirs==4.5.1
 + pluggy==1.6.0
 + robotcode==2.2.0
 + robotcode-analyze==2.2.0
 + robotcode-core==2.2.0
 + robotcode-plugin==0.86.2
 + robotcode-robot==2.2.0
 + robotframework==7.4.1
 + tomli-w==1.2.0
 + typing-extensions==4.15.0
(test) $ robotcode anaylze code test.robot 
Traceback (most recent call last):
  File "/test/test/bin/robotcode", line 4, in <module>
    from robotcode.cli.__main__ import main
  File "/test/test/lib/python3.12/site-packages/robotcode/cli/__init__.py", line 22, in <module>
    from .commands import config, profiles
  File "/test/test/lib/python3.12/site-packages/robotcode/cli/commands/__init__.py", line 1, in <module>
    from .config import config
  File "/test/test/lib/python3.12/site-packages/robotcode/cli/commands/config.py", line 265, in <module>
    @info.command()
     ^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'command'

Desktop (please complete the following information):

  • RobotCode Version 2.2.0
  • OS: Fedora 43
  • Python Version 3.12.12
  • RobotFramework Version 7.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions