Conversation
* autopep8 * wrap * autopep8 fixup
|
Link to test |
|
Ok, CI build failed. I have some work to do I guess. |
|
@brawner Ping me when this is ready to be reviewed |
dirk-thomas
left a comment
There was a problem hiding this comment.
When moving / renaming existing file (like python_qt_binding/binding_helper.py) please use a separate commit for that - that will "help" git to track the history of the file.
CMakeLists.txt
Outdated
| catkin_python_setup() | ||
| ament_python_install_package(${PROJECT_NAME}) | ||
|
|
||
| set(python_qt_binding_CMAKE_DIRS cmake) |
There was a problem hiding this comment.
Where is this variable being used?
CMakeLists.txt
Outdated
| cmake/sip_configure.py | ||
| cmake/sip_helper.cmake | ||
| DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake) | ||
| DESTINATION share/${PROJECT_NAME}/cmake/) |
CMakeLists.txt
Outdated
| ament_lint_auto_find_test_dependencies() | ||
|
|
||
| ament_add_pytest_test(pqt_test test | ||
| PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}" |
There was a problem hiding this comment.
This is the default value so it doesn't need to be passed explicitly.
CMakeLists.txt
Outdated
|
|
||
| ament_add_pytest_test(pqt_test test | ||
| PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}" | ||
| APPEND_ENV AMENT_PREFIX_PATH=${ament_index_build_path} |
There was a problem hiding this comment.
Where is the variable ament_index_build_path being defined?
There was a problem hiding this comment.
Leftover from a copy-paste job. Removed append to AMENT_PREFIX_PATH
LICENSE
Outdated
| @@ -0,0 +1,202 @@ | |||
|
|
|||
| Apache License | |||
There was a problem hiding this comment.
The existing code is licensed under BSD. You can't change the license of it without an agreement of all contributors.
There was a problem hiding this comment.
Whoops, sorry! Trying to pass test_copyright.py tests, but I had removed that awhile ago.
python_qt_binding/__init__.py
Outdated
| from python_qt_binding.binding_helper import \ | ||
| loadUi, QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION | ||
|
|
||
| print('Qt5 Python Binding {}: Version {}'.format(QT_BINDING, QT_BINDING_VERSION)) |
There was a problem hiding this comment.
This message was probably used for debugging and should be removed again.
There was a problem hiding this comment.
This line was added, as well as the loadUI = loadUi so that flake8 would not complain about unused variables. Because the init exposes loadUI, QT_BINDING and QT_BINDING_VERSION, but doesn't use them in the file flake8 thinks they are unused.
@dirk-thomas Do you have a recommended resolution?
There was a problem hiding this comment.
You can suppress a specific flake8 warning by appending # noqa: X123 to the line.
There was a problem hiding this comment.
Adding noqa: F401 to suppress unused imports. I guess it's recommended to add these to an all variable, but I'm not sure how that would work with the dynamic module imports associated with this package.
python_qt_binding/__init__.py
Outdated
| loadUi, QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION | ||
|
|
||
| print('Qt5 Python Binding {}: Version {}'.format(QT_BINDING, QT_BINDING_VERSION)) | ||
| loadUi = loadUi |
There was a problem hiding this comment.
What is this line about?
There was a problem hiding this comment.
Removed in favor of noqa: F401
| @@ -1,5 +1,3 @@ | |||
| #!/usr/bin/env python | |||
There was a problem hiding this comment.
Please keep this line. It allows to invoke the file directly to test the selected binding.
There was a problem hiding this comment.
Reverting this line
python_qt_binding/binding_helper.py
Outdated
|
|
||
| def loadUi(uifile, baseinstance=None, custom_widgets=None): | ||
| """ | ||
| Load a provided UI file using PySide2. |
There was a problem hiding this comment.
The reference of PySide2 is incorrect. This function uses the selected binding.
setup.py
Outdated
|
|
||
| try: | ||
| from setuptools import setup | ||
| from setuptools import setup, find_packages |
There was a problem hiding this comment.
In the case of an exception the symbol find_packages isn't defined and would therefore fail later.
There was a problem hiding this comment.
This was part of debugging, reverting to the old setup.py
|
Also moving the Python package out of the |
|
@dirk-thomas from your comments on slack, I found how to set the PACKAGE_DIR argument with ament_python_install_package. Moving files back to src |
|
CI build and tests passed |
CMakeLists.txt
Outdated
| DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake) | ||
| DESTINATION share/${PROJECT_NAME}/cmake) | ||
|
|
||
| if(BUILD_TESTING) |
There was a problem hiding this comment.
Everything from here shouldn't be indented.
CMakeLists.txt
Outdated
| find_package(ament_lint_auto REQUIRED) | ||
| ament_lint_auto_find_test_dependencies() | ||
|
|
||
| ament_add_pytest_test(pqt_test test |
There was a problem hiding this comment.
pqt_test - hat does pqt stand for?
CONTRIBUTING.md
Outdated
| Notwithstanding the above, nothing herein shall supersede or modify | ||
| the terms of any separate license agreement you may have executed | ||
| with Licensor regarding such Contributions. | ||
| ~~~ |
There was a problem hiding this comment.
This is still mentioning the wrong license.
cmake/python_qt_binding-extras.cmake
Outdated
| @@ -0,0 +1,2 @@ | |||
| # location of cmake files in installspace | |||
| set(python_qt_binding_EXTRAS_DIR "${python_qt_binding_DIR}") | |||
There was a problem hiding this comment.
If the variable isn't used anywhere (in downstream packages?) then it can be removed.
|
I syncronized the |
This ports python_qt_binding to work with ros2 crystal. I've also added tests to ensure pyqt or pyside are installed correctly and the package works as intended.