robotcode icon indicating copy to clipboard operation
robotcode copied to clipboard

[QUESTION] python path configuration and pyproject.toml support

Open adamweld opened this issue 1 year ago • 1 comments

Hi, first of all, thank you for this project, it's really great and already quite helpful.

I was wondering, what is the suggested way to add a custom libraries directory for the extension?

I am trying the following robot.toml file: python-path = [ "/src/my_package/libraries" ] output-dir = [ "output" ]

however with this file created, intellisense seems to break and I am no longer able to follow function definitions.

PS, it would be great to support pyproject.toml configuration e.g. under [tool.robotidy] which I understand is generally interchangeable with robot.toml

adamweld avatar Aug 29 '24 17:08 adamweld

if your libraries are in your project folder then you must use relative paths in the python-path setting.

python-path = [ "src/my_package/libraries" ]
output-dir = [ "output" ]

and yes you can also use thy pyproject.toml, but to separate the things a little bit better, there is the robot.toml Everything regarding python goes to the pyproject.toml and everything regarding robot goes to the robot.toml

In a pyproject.toml we use the prefix tool.robot, so your example above should look like

[tool.robot]
python-path = [ "src/my_package/libraries" ]
output-dir = [ "output" ]

d-biehl avatar Aug 29 '24 20:08 d-biehl

Does that work for you?

d-biehl avatar Sep 16 '24 19:09 d-biehl