Skip to content

Fix SOFAPYTHON_PLUGINS_PATH env var with Windows (and add a warning error)#349

Merged
alxbilger merged 4 commits intosofa-framework:masterfrom
fredroy:fix_envvar_win
Jun 14, 2023
Merged

Fix SOFAPYTHON_PLUGINS_PATH env var with Windows (and add a warning error)#349
alxbilger merged 4 commits intosofa-framework:masterfrom
fredroy:fix_envvar_win

Conversation

@fredroy
Copy link
Copy Markdown
Contributor

@fredroy fredroy commented May 11, 2023

and deprecate it in favor of SOFAPYTHON3_PLUGINS_PATH to be more consistent with the other names.

Use system::FileRepository instead of manually handle the content of the env var.
Especially that it was not handling the correct separating marker for Windows (which is ";" instead of ":" apparently)

PLUS
Added a message when the path given to addPythonModulePath is not correct.
This actually happens often, e.g BeamAdapter/Cosserat did not update their cmake config when the python3 was renamed.
With Cosserat you get Added 'D:/sofa/src/plugins/CosseratPlugin/python' to sys.path even if the directory does not exist.

Comment thread Plugin/src/SofaPython3/PythonEnvironment.cpp Outdated
Copy link
Copy Markdown
Contributor

@alxbilger alxbilger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case both environment variables are found, I think you pick the deprecated one in priority. I am not sure we want that. I would add the condition that the new environment variable is not found

@alxbilger alxbilger merged commit 36682dd into sofa-framework:master Jun 14, 2023
damienmarchal pushed a commit that referenced this pull request Sep 13, 2024
…rror) (#349)

* Fix handling env var sp3pluginpath with windows

* more info in the message

* use sofapy3_plugins_path if both are set

* fix compil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants