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

Add py.typed to package #946

Merged
merged 1 commit into from
May 31, 2022
Merged

Conversation

bonprosoft
Copy link
Contributor

@bonprosoft bonprosoft commented May 26, 2022

I added py.typed file to mark the package PEP561-compatible.
This would be helpful for static type checkers.

Closes #936

cc: @adityapande-1995

Signed-off-by: Yuki Igarashi [email protected]

Signed-off-by: Yuki Igarashi <[email protected]>
Copy link

@adityapande-1995 adityapande-1995 left a comment

Choose a reason for hiding this comment

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

Looks good ! Is there a way we could add a test for this using our CI ?

@bonprosoft
Copy link
Contributor Author

bonprosoft commented May 28, 2022

Is there a way we could add a test for this using our CI?

I'm not sure.
Because py.typed is copied into the package dir by ament_cmake_python, I don't think it is reasonable to check if the file is located in the package directory by pytest, which is for testing python modules.

If such test is highly necessary, let me think about the approach 😃

@aprotyas
Copy link
Member

aprotyas commented May 28, 2022

Yes, I agree that PEP561 compatibility shouldn't/can't really be tested like the rest of rclpy's test suite.

Regardless, running CI for this change.

Repos file: https://gist.github.com/aprotyas/af5130e8d82be0011957df611898ca7e
Build args: --packages-above-and-dependencies rclpy
Test args: --packages-above rclpy
Job: https://ci.ros2.org/job/ci_launcher/10341/

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

Edit: warnings look unrelated to this patch.

@adityapande-1995 adityapande-1995 merged commit 2c8ffe0 into ros2:master May 31, 2022
@bonprosoft bonprosoft deleted the fix/add-py-typed branch June 2, 2022 15:53
@ros-discourse
Copy link

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

https://discourse.ros.org/t/python-type-checking-in-ros2/28507/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include py.typed in a package
4 participants