Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1901684

Summary: cannot use ansible-review because of ImportError from ansiblelint
Product: [Fedora] Fedora Reporter: Heldwin <heldwin>
Component: ansible-reviewAssignee: Nils Philippsen <nphilipp>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: djc, mhroncok, nphilipp, releng, thrnciar, timo
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-24 08:36:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1868278, 1890881, 1927309, 1927313, 1992484, 1992487    

Description Heldwin 2020-11-25 19:57:37 UTC
Description of problem:
I cannot use ansible-review, it crashes with an ImportError.

Version-Release number of selected component (if applicable):
python3-ansible-review-0.13.9-6.fc33.noarch
python3-ansible-lint-4.3.5-1.fc33.noarch


Traceback (most recent call last):
  File "/usr/bin/ansible-review", line 33, in <module>
    sys.exit(load_entry_point('ansible-review==0.13.9', 'console_scripts', 'ansible-review')())
  File "/usr/bin/ansible-review", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib64/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/ansiblereview/__init__.py", line 1, in <module>
    from ansiblelint import default_rulesdir, RulesCollection
ImportError: cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.9/site-packages/ansiblelint/__init__.py)

Comment 1 Nils Philippsen 2021-02-24 13:39:25 UTC
*** Bug 1923667 has been marked as a duplicate of this bug. ***

Comment 2 Miro Hrončok 2021-06-04 20:13:28 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 3 Miro Hrončok 2021-06-07 22:58:16 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 4 Miro Hrončok 2021-06-08 11:13:16 UTC
*** Bug 1968776 has been marked as a duplicate of this bug. ***

Comment 5 Miro Hrončok 2021-06-21 07:39:47 UTC
The Python 3.10 rebuild fails with:

+ nosetests-3.10 -v test/
Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)) ... ERROR
Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)) ... ERROR
Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)) ... ERROR
Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)) ... ERROR
======================================================================
ERROR: Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.10/site-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib64/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib64/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/ansible-review-0.13.9/test/TestCreation.py", line 24, in <module>
    from ansiblereview import Playbook, Inventory
  File "/builddir/build/BUILD/ansible-review-0.13.9/lib/ansiblereview/__init__.py", line 1, in <module>
    from ansiblelint import default_rulesdir, RulesCollection
ImportError: cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)
======================================================================
ERROR: Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.10/site-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib64/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib64/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/ansible-review-0.13.9/test/TestDiffEncoding.py", line 6, in <module>
    import ansiblereview.__main__ as main
  File "/builddir/build/BUILD/ansible-review-0.13.9/lib/ansiblereview/__init__.py", line 1, in <module>
    from ansiblelint import default_rulesdir, RulesCollection
ImportError: cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)
======================================================================
ERROR: Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.10/site-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib64/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib64/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/ansible-review-0.13.9/test/TestUtils.py", line 24, in <module>
    from ansiblereview import Playbook, Task, Code
  File "/builddir/build/BUILD/ansible-review-0.13.9/lib/ansiblereview/__init__.py", line 1, in <module>
    from ansiblelint import default_rulesdir, RulesCollection
ImportError: cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)
======================================================================
ERROR: Failure: ImportError (cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.10/site-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.10/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib64/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib64/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/ansible-review-0.13.9/test/TestYamlReview.py", line 3, in <module>
    from ansiblereview.utils.yamlindent import yamlreview
  File "/builddir/build/BUILD/ansible-review-0.13.9/lib/ansiblereview/__init__.py", line 1, in <module>
    from ansiblelint import default_rulesdir, RulesCollection
ImportError: cannot import name 'default_rulesdir' from 'ansiblelint' (/usr/lib/python3.10/site-packages/ansiblelint/__init__.py)
----------------------------------------------------------------------
Ran 4 tests in 0.012s

Comment 6 Miro Hrončok 2021-07-26 09:02:55 UTC
Could you please have a look?

Comment 7 Ben Cotton 2021-08-10 12:49:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 8 Miro Hrončok 2021-08-23 12:05:18 UTC
This was retired in F35 and rawhide:

https://src.fedoraproject.org/rpms/ansible-review/c/9d712ad49b47017499e996b7fed8962a607bc093?branch=f35
https://src.fedoraproject.org/rpms/ansible-review/c/a395602895db0e830314e1c702fc36f94675c8ad?branch=rawhide

Setting to MODIFIED. The "fails to install" bugzilla script does not like bugzillas closed before the package is blocked in Koji.

Comment 9 Nils Philippsen 2021-08-23 12:17:15 UTC
As discussed on IRC, I took this up with upstream a while ago, to no avail -- PRs and issues have been piling up there, it looks dead. I've retired the package in F35, Rawhide and will add it to fedora-obsolete-packages.

Comment 10 Nils Philippsen 2021-08-23 12:24:21 UTC
As discussed :) I won't update fedora-obsolete-packages myself.

Comment 11 Miro Hrončok 2021-08-24 08:36:28 UTC
The package is now retired from Fedora 35+