-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support non-default python layouts #123
Support non-default python layouts #123
Conversation
@tfoote are you going to be able to review this? |
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.
I'm on paternity leave until mid July so will have high latency and minimal bandwidth available. I put some thoughts in on this, I'd like to understand a bit more about whether we should be adding complexity to support automatically discovering the non-standard layouts/naming conventions vs providing a mechanism to just set this in rosdoc2.yaml etc.
@@ -49,7 +49,7 @@ | |||
## be assumed for 'sphinx-apidoc' invocation. The user can provide the path | |||
## (relative to the 'package.xml' file) where the Python modules defined by this | |||
## package are located. | |||
python_source: '{package_name}' | |||
# python_source: '{package_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.
Can the above cases not be covered by setting this non-standard location in their config files?
Implementing custom discovery logic seem fragile and like it will end up with a lot of maintenance in the longer term versus setting the non-standard location in the configuration for those handful of packages. And we can make sure that we provide a useful error/warning such that developers can know to set this setting in their config file.
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.
Just to be clear, the reason for the change in the line that you quoted is because {package_name} is the default. I would expect that a sample config file shows what the default is, but does not set it unless setting it is required. It is not.
Concerning "whether we should be adding complexity to support automatically discovering the non-standard layouts/naming conventions vs providing a mechanism to just set this in rosdoc2.yaml": I feel strongly about:
I don't feel strongly about fixing deviations from those two standards. One example is urdfdom_py, with the source in src/urdf_parser_py (that is, a slightly different name than the actual package name.) But generally, I don't have a lot of confidence that package authors are going to add rosdoc2.yaml entries to fix minor differences in order to make rosdoc2 happy. I would rather have things "just work", and I am not convinced this adds much complexity to rosdoc2. But I'll do what you want. If you want me to eliminate the search for misnamed subdirectories then I will. |
I agree with this first bullet. Expected error cases should be handled with error messages addressing the user rather than a raw stacktrace.
I have less of an opinion about this bullet but I'm not opposed to it either.
There's a pattern that I've seen for situations like this where a program is guessing about intended behavior which is to nag / warn that the program is guessing, then do it anyway, but suggest that a configuration be set to make what the program is guessing explicit. I think it's reasonable to push packages that don't adhere to standards to declare what they want instead in order to prevent the heuristics, which may be simple today, from growning unbounded without warning people that they might break under future versions without a config.
I can't speak for @tfoote but splitting this PR in half, with the first adding support for the two agreed upon cases (flat and src) and providing a follow-up for others would allow me to feel comfortable reviewing and merging the former without waiting for @tfoote. |
72ecb9e
to
950982b
Compare
This is the 'first half' that supports src layout. Also does not crash if there is an issue. The earlier pushes had some git merge complications, this version should be a squash that just shows the current changes. |
Fixes #122
The changes made here are:
Tests are included for a variety of cases.
With these changes, the following packages that were not generating output before, now generate a proper output:
These packages that previously failed, now generate html but do not fully document their python:
One python package still fails for another reason:
Many of these could have been made to work previously with the correct specification in rosdoc2.yaml. But philosophically, I think we should try to succeed (with warnings) rather than just abort if the user fails to follow the conventions we expect.