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

Fix ros2 launch #147

Merged
merged 2 commits into from May 11, 2020
Merged

Fix ros2 launch #147

merged 2 commits into from May 11, 2020

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented May 7, 2020

As @dirk-thomas indicates in this comment

argcomplete it doesn't support Windows.

Moved the argcomplete outside the try catch.

@ahcorde ahcorde added the bug Something isn't working label May 7, 2020
@ahcorde ahcorde requested a review from dirk-thomas May 7, 2020 15:32
@ahcorde ahcorde self-assigned this May 7, 2020
@dirk-thomas
Copy link
Member

Please run code you change to confirm it works as expected. FilesCompleter is being used in the module and will raise if not imported.

argcomplete it doesn't support Windows. Moved the `argcomplete` outside the try catch

Signed-off-by: ahcorde <ahcorde@gmail.com>
@ahcorde ahcorde force-pushed the ahcorde/fix/argcomplete_windows branch from 07762e4 to 4ba8cf7 Compare May 7, 2020 16:12
Copy link
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

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

LGTM (haven't tried it though).

@ahcorde
Copy link
Contributor Author

ahcorde commented May 7, 2020

I tried on Windows and Ubuntu Focal.

is it enough to run CI up-to ros2lanch and run only these tests?

@dirk-thomas
Copy link
Member

dirk-thomas commented May 7, 2020

is it enough to run CI up-to ros2lanch and run only these tests?

I don't think any unit test uses ros2 launch. So the CI build will only be for linters.

@ahcorde
Copy link
Contributor Author

ahcorde commented May 8, 2020

I ckecked other PR related with argcomplete #126, it's only testing ros2launch. I also checked system_test repository, but it's only testing parameters and remappings.

CI (testing just ros2launch)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@jacobperron
Copy link
Member

I think this fixes an issue on all platforms (not just Windows). I've run into it on Linux. The code before this patch assumes that argcomplete is installed, but it is optional according to our docs. Trying ros2 launch (or even ros2 --help) on a fresh installation results in the error:

Failed to load entry point 'launch': No module named 'argcomplete'

try:
from argcomplete.completers import FilesCompleter
except ImportError:
# argcomplete is not supported on Windows
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: A better comment might indicate that argcomplete is optional

Suggested change
# argcomplete is not supported on Windows
# argcomplete is optional

@jacobperron
Copy link
Member

I can confirm this PR resolves my issue on Linux.

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

I suggest updating the PR title and/or the comments in the code to indicate this patch is making argcomplete optional.

@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/ros-2-foxy-fitzroy-call-for-testing-and-package-releases/13998/1

@ahcorde ahcorde changed the title Fix ros2 launch on Windows Fix ros2 launch May 11, 2020
Signed-off-by: ahcorde <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented May 11, 2020

thank you @jacobperron

@ahcorde ahcorde merged commit 7bd5552 into master May 11, 2020
@delete-merged-branch delete-merged-branch bot deleted the ahcorde/fix/argcomplete_windows branch May 11, 2020 09:20
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

Successfully merging this pull request may close these issues.

None yet

4 participants