Skip to content

[BUG] RobotCode InteliJ plugin could not recognize source root as PYTHONPATH #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shaoerkuai opened this issue Apr 18, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@shaoerkuai
Copy link

shaoerkuai commented Apr 18, 2025

Describe the bug
Current run configuration will not mark source root/content root but Python run configuration supports that.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Init a project with directory 'testcases' to store robot files.
  2. Prepare a 'library' directory to store my Python files and Mark this as a source root
  3. Check robot file editor
  4. All imports by 'Library' keywords warned as 'No module named 'xxx' found '

If possible add some example source code like:

***Settings***
Library common.geo.geotools

***Test Cases***
a simple test
    do something    # this should shown something

Desktop (please complete the following information):

  • RobotCode Version [latest]
  • OS: [Windows]
  • Python Version [3.11]
  • RobotFramework Version [4.1.3]
@shaoerkuai shaoerkuai added the bug Something isn't working label Apr 18, 2025
@shaoerkuai
Copy link
Author

Since IT department restricts upload screenshot to github, I am willing to push more information literally for you if needed. Thanks.

@d-biehl
Copy link
Member

d-biehl commented May 21, 2025

I know this feature of from IntelliJ, but I did not use it for python projects because there are some standards on how to setup python projects and there are python project manager like poetry or hatch. If you use these manager all python path things are handled by these managers.

RobotCode has also a default settings, just create a lib folder instead a library folder. And you can use a robot.toml file to define the python path for robot framework projects.

But because this seems to be a common feature in PyCharm, maybe you can provide a little more information, maybe a screenshot and how you are working with this? If so, we can convert this bug description to an enhancement request.

@shaoerkuai
Copy link
Author

shaoerkuai commented May 22, 2025

Image

Image

it is a bit confusing when users manually configure the extension paths in robot.toml.
My idea is that RobotCode can directly get those folders marked as source root paths and add them to the recognized PYTHONPATH since it's a useful and common feature that IntelliJ has.

@shaoerkuai
Copy link
Author

I reinstalled the system and used the latest IDEA Ultimate and 2025.1.1.1, as well as Robotframework 7.2.2.

Image
It is very regrettable that this problem occurred during run the configuration (I need to investigate this further), so I couldn't reproduce the second of two:

  1. IntelliSense failed as above.
  2. ModuleNotFoundError in robot frame work runtime (Not reproducible at this time).

I have somewhat forgotten the specific scenario of this problem, it should be divided into two cases.

This can be solved by adding a new robot.toml configuration, but I hope there will be enhanced features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants