-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unit test friendly folder structure for Python examples #237
Conversation
8d1ee44
to
9b04476
Compare
@@ -55,6 +55,7 @@ def generate_parameter_module(module_name, yaml_file, validation_module=''): | |||
install_dir = os.path.join( | |||
colcon_ws, | |||
'install', | |||
pkg_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be fixed in #236, but needed for this PR to work properly
8e14998
to
52e7c43
Compare
52e7c43
to
37ad69e
Compare
2eb5336
to
b0aee7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't have much experience with python install stuff to review that 🤷♂️
No worries, I'm hoping the handful of people engaged in the associated issue will get a chance to test here. I just can't officially tag most of them as reviewers as they are not repo collaborators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally with my own package and this fixes my testing issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much needed, thank you!
@christophfroehlich could you give me a green approve on behalf of Marq and Bence, so I can merge this and cut the release? 🙏🏻 |
@sea-bass I'm sorry I'm late, I see this has already been merged! I left a comment on the issue #233 (comment). I might be missing something, but removing the Additionally, it's true that package does successfully build, but I now have the following stderr, which also suggests that this isn't standard practice:
In any case, thank you very much for your reactivity and work on this issue! |
Oh, interesting. I had not seen that warning for some reason. That is... not ideal. Yeah, it's a problem because this isn't a "regular" Python module where all the code is available in the source folder. I guess if we go back to the state before this PR, the only bulletproof way to test these generared modules is to do it from another package. Anyways, would suggest we keep iterating and if we find something good we can release again. Thanks! |
@sea-bass I agree with iterating. I only wanted to point out that this will break existing unit tests for users that are trying to adopt I think part of the issue is that the generated parameter module is treated as something "compiled" like in C++. However, from what I understand that isn't how Python works, which is why everything is in the source folder. As a potential solution to the source control issue that you mentioned here: #233 (comment), the user could add it to their Thank you again for your help! |
Attempts to address #233 by moving files around so that there is no module that could be wrongly imported in the source folder of the Python example package.
Turns out the key is to just not have an
__init__.py
file in the module in the source folder, but instead to generate it only into install space.... and just as before, if you install with
--symlink-install
, the__init__.py
file will be thrown into the source folder anyhow.