-
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
Merged
nuclearsandwich
merged 1 commit into
ros-infrastructure:main
from
rkent:allow-source-python-layout
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ | |
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
<rosdoc2>rosdoc2.yaml</rosdoc2> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>false_python</name> | ||
<version>0.0.0</version> | ||
<description>I say I am python, but no actual python</description> | ||
<maintainer email="[email protected]">Ye ol' Python Pro</maintainer> | ||
<license>Apache-2.0</license> | ||
<export> | ||
<build_type>ament_python</build_type> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>invalid_python_source</name> | ||
<version>0.0.0</version> | ||
<description>This packages incorrectly specifies python source</description> | ||
<maintainer email="[email protected]">ros2 user</maintainer> | ||
<license>Apache 2.0</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<buildtool_depend>ament_cmake_python</buildtool_depend> | ||
<export> | ||
<build_type>ament_cmake</build_type> | ||
<rosdoc2>rosdoc2.yaml</rosdoc2> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## Default configuration, generated by rosdoc2. | ||
|
||
## This 'attic section' self-documents this file's type and version. | ||
type: 'rosdoc2 config' | ||
version: 1 | ||
|
||
--- | ||
|
||
settings: | ||
## If this is true, a standard index page is generated in the output directory. | ||
## It uses the package information from the 'package.xml' to show details | ||
## about the package, creates a table of contents for the various builders | ||
## that were run, and may contain links to things like build farm jobs for | ||
## this package or links to other versions of this package. | ||
|
||
## If false, you can still include content that would have been in the index | ||
## into one of your '.rst' files from your Sphinx project, using the | ||
## '.. include::' directive in Sphinx. | ||
## For example, you could include it in a custom 'index.rst' so you can have | ||
## the standard information followed by custom content. | ||
|
||
## TODO(wjwwood): provide a concrete example of this (relative path?) | ||
|
||
## If this is not specified explicitly, it defaults to 'true'. | ||
generate_package_index: true | ||
|
||
## This setting is relevant mostly if the standard Python package layout cannot | ||
## 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: 'i_do_not_exist' | ||
|
||
## This setting, if true, attempts to run `doxygen` and the `breathe`/`exhale` | ||
## extensions to `sphinx` regardless of build type. This is most useful if the | ||
## user would like to generate C/C++ API documentation for a package that is not | ||
## of the `ament_cmake/cmake` build type. | ||
always_run_doxygen: false | ||
|
||
## This setting, if true, attempts to run `sphinx-apidoc` regardless of build | ||
## type. This is most useful if the user would like to generate Python API | ||
## documentation for a package that is not of the `ament_python` build type. | ||
always_run_sphinx_apidoc: false | ||
|
||
# This setting, if provided, will override the build_type of this package | ||
# for documentation purposes only. If not provided, documentation will be | ||
# generated assuming the build_type in package.xml. | ||
# override_build_type: 'ament_python' | ||
builders: | ||
## Each stanza represents a separate build step, performed by a specific 'builder'. | ||
## The key of each stanza is the builder to use; this must be one of the | ||
## available builders. | ||
## The value of each stanza is a dictionary of settings for the builder that | ||
## outputs to that directory. | ||
## Required keys in the settings dictionary are: | ||
## * 'output_dir' - determines output subdirectory for builder instance | ||
## relative to --output-directory | ||
## * 'name' - used when referencing the built docs from the index. | ||
|
||
- doxygen: { | ||
name: 'basic_cpp Public C/C++ API', | ||
output_dir: 'generated/doxygen' | ||
} | ||
- sphinx: { | ||
name: 'basic_cpp', | ||
## This path is relative to output staging. | ||
doxygen_xml_directory: 'generated/doxygen/xml', | ||
output_dir: '' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print('This is a dummy launch file') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>src_alt_python</name> | ||
<version>0.0.0</version> | ||
<description>Python with python module name different from ros name</description> | ||
<maintainer email="[email protected]">Ye ol' Python Pro</maintainer> | ||
<license>Apache-2.0</license> | ||
<export> | ||
<build_type>ament_python</build_type> | ||
</export> | ||
</package> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def main(): | ||
print('Hello, world.') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
1 change: 1 addition & 0 deletions
1
test/packages/src_alt_python/src/other_name/subpackage/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This package should not be the python source because it is a sub package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>src_python</name> | ||
<version>0.0.0</version> | ||
<description>Basic Python node with source layout</description> | ||
<maintainer email="[email protected]">Ye ol' Python Pro</maintainer> | ||
<license>Apache-2.0</license> | ||
<export> | ||
<build_type>ament_python</build_type> | ||
</export> | ||
</package> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def main(): | ||
print('Hello, world.') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>too_many_python_packages</name> | ||
<version>0.0.0</version> | ||
<description>Too many unspecified python packages</description> | ||
<maintainer email="[email protected]">ros2 user</maintainer> | ||
<license>Apache 2.0</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<buildtool_depend>ament_cmake_python</buildtool_depend> | ||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
Empty file.
6 changes: 6 additions & 0 deletions
6
test/packages/too_many_python_packages/package1/python_node.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def main(): | ||
print('Hello, world.') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Empty file.
6 changes: 6 additions & 0 deletions
6
test/packages/too_many_python_packages/package2/python_node.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def main(): | ||
print('Hello, world.') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.