Skip to content
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

Export PYTHONPATH when sourcing the workspace #271

Closed
wants to merge 1 commit into from

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Oct 29, 2021

Signed-off-by: ahcorde [email protected]

🦟 Bug fix

Summary

This PR is related to this issues #270

When compiling from source and loading the workspace we should be able to setup the PYTHONPATH to allow user to use the Python bindings

There is a discussion in the ign-cmake gazebosim/gz-cmake#185 repository to include this functionality.

One cons about this solution if that if you source the workspace several times you will append the path to the pythonpath each time.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

@ahcorde ahcorde self-assigned this Oct 29, 2021
@github-actions github-actions bot added Gazebo 1️1️ Dependency of Gazebo classic version 11 🌱 garden Ignition Garden 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress 🏰 citadel Ignition Citadel 🔮 dome Ignition Dome labels Oct 29, 2021
@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #271 (b1343b4) into ign-math6 (c732c04) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           ign-math6     #271   +/-   ##
==========================================
  Coverage      99.41%   99.41%           
==========================================
  Files             67       67           
  Lines           6374     6374           
==========================================
  Hits            6337     6337           
  Misses            37       37           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c732c04...b1343b4. Read the comment docs.

@@ -0,0 +1,4 @@
# Configuration file for colcon (https://colcon.readthedocs.io).
{
"hooks": ["share/ignition-math6/setup.sh"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to gazebosim/gazebo-classic#3066, I think we should be careful about adding files specific to certain tools, and instead try to find solutions that apply to most setups.

With that in mind, we should at a minimum add instructions for users to source the setup file on their own when using debs or plain cmake.

@chapulina chapulina added the scripting Scripting interfaces to Ignition label Oct 29, 2021
@chapulina
Copy link
Contributor

@ahcorde , as mentioned in a meeting, let's add documentation instructing users to source the setup file directly when using plain CMake. Also note that this is not needed for debian installations, as we're already installing the scripts in the correct path.

@@ -0,0 +1,3 @@
# generated from ignition-math/setup.sh.in

export PYTHONPATH=@CMAKE_INSTALL_PREFIX@/@IGN_PYTHON_INSTALL_PATH@:$PYTHONPATH
Copy link
Contributor

Choose a reason for hiding this comment

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

This is being set to install/lib/python/swig, should it be install/lib/python?

@chapulina chapulina removed the 🌱 garden Ignition Garden label Dec 30, 2021
@ahcorde
Copy link
Contributor Author

ahcorde commented Jan 10, 2022

This tutorial explains how to do it. Closing this

@ahcorde ahcorde closed this Jan 10, 2022
@chapulina chapulina deleted the ahcorde/python/hook branch January 10, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel 🔮 dome Ignition Dome 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress Gazebo 1️1️ Dependency of Gazebo classic version 11 scripting Scripting interfaces to Ignition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants