-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Import test doesn't recognize relative imports in a module inside collection #61884
Comments
Files identified in the description:
If these files are inaccurate, please update the |
I hit the same thing, output was slightly different
The important thing here is that none of the other errors are reported. So I don't think we can just ignore this particular type of error. |
#62496 is also related |
I tried to hack around this by substituting the package name where we were using
Either I'm doing this wrong, or this is a problem general for collections with module_utils. |
- Relative imports are now properly recognized. - Correct script invocation of Ansible modules is used. - Warnings are now consistently reported as errors. - Errors are now consistently reported with the file tested. Resolves ansible#62723 Resolves ansible#61884
- Relative imports are now properly recognized. - Correct script invocation of Ansible modules is used. - Warnings are now consistently reported as errors. - Errors are now consistently reported with the file tested. Resolves ansible#62723 Resolves ansible#61884
- Relative imports are now properly recognized. - Correct script invocation of Ansible modules is used. - Warnings are now consistently reported as errors. - Errors are now consistently reported with the file tested. Resolves ansible#62723 Resolves ansible#61884 (cherry picked from commit 92ccdea) Co-authored-by: Matt Clay <matt@mystile.com>
* [stable-2.9] Fix various import sanity test issues. - Relative imports are now properly recognized. - Correct script invocation of Ansible modules is used. - Warnings are now consistently reported as errors. - Errors are now consistently reported with the file tested. Resolves #62723 Resolves #61884 (cherry picked from commit 92ccdea) Co-authored-by: Matt Clay <matt@mystile.com> * Changelog entry for ansible-test sanity fixes. (cherry picked from commit 0923ed5)
@nitzmahone some more details in #63084 (comment) More or less, I don't think this is fixed. In the current devel branch, I get these error types:
I have a script that replaces the relative imports with absolute imports. If I run this, and then run sanity tests, I'm left with:
One of these error describes #62496 However, the error "attempted relative import with no known parent package" with relative imports is this issue, and in current |
@AlanCoding These are two separate issues. This issue was for the import sanity test. The errors you're referring to are for the validate-modules sanity test, which should be fixed by #63932. |
- Relative imports are now properly recognized. - Correct script invocation of Ansible modules is used. - Warnings are now consistently reported as errors. - Errors are now consistently reported with the file tested. Resolves ansible#62723 Resolves ansible#61884
SUMMARY
When trying to check support of relative imports in modules inside collections, import sanity test fails giving below error
ISSUE TYPE
COMPONENT NAME
ansible-test sanity import
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Create a collection with modules having relative imports
Try running ansible-test sanity on the same module
EXPECTED RESULTS
Relative imports should pass
ACTUAL RESULTS
ansible import tests doesn't recognize relative import
The text was updated successfully, but these errors were encountered: