Bug 1335144 - python-stuf: ImportError: cannot import name items
Summary: python-stuf: ImportError: cannot import name items
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-stuf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1285544
TreeView+ depends on / blocked
 
Reported: 2016-05-11 12:31 UTC by Tomas Orsava
Modified: 2016-07-27 19:18 UTC (History)
4 users (show)

Fixed In Version: python-stuf-0.9.16-7.fc24 python-stuf-0.9.16-7.fc23 python-stuf-0.9.16-7.fc22 python-stuf-0.9.16-8.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-10 05:57:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomas Orsava 2016-05-11 12:31:21 UTC
Description of problem:
When I try to do 'import stuf' inside Python 2 or Python 3 interactive interpreter, I get the following traceback:

Python 2.7.11 (default, Mar 31 2016, 20:46:51)
[GCC 5.3.1 20151207 (Red Hat 5.3.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import stuf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/stuf/__init__.py", line 4, in <module>
    from stuf.iterable import (
  File "/usr/lib/python2.7/site-packages/stuf/iterable.py", line 7, in <module>
    from .six import items, map, next
ImportError: cannot import name items


Version-Release number of selected component (if applicable):
Package python2-stuf-0.9.16-5.fc23.noarch
Package python3-stuf-0.9.16-5.fc23.noarch

Tested on my Fedora 23, and in mock on Fedora 23 and rawhide.


How reproducible:
Every time

Steps to Reproduce:
1. install python2-stuf or python3-stuf
2. python2 or python3
3. import stuf

Actual results:
Traceback

Expected results:
Module is imported

Additional info:
-

Comment 1 Ling Li 2016-05-19 21:20:51 UTC
This puzzles me too.  I am not sure which "six" package python2-stuf uses.  In addition to "items", it also requires six to provide OrderedDict (stuf.collects, line 8), which according to this link https://bitbucket.org/gutworth/six/issues/42/ordereddict-for-python-27 is never included in six.

Comment 2 Ling Li 2016-05-19 21:26:41 UTC
I see.  python-stuf uses its own version of six.py, but the RPM packaging procedure replaces that with the system-wide one (see the changelog below).

* Mon Nov 30 2015 Ralph Bean <rbean> - 0.9.16-2
...
- Unbundle and add dep on python-six and python3-six.

Comment 3 Tomas Orsava 2016-05-20 08:18:48 UTC
Ah, that makes sense. So, I guess the problem is the bundled version of "six" is customized and not compatible with the standard upstream version of "six"?

I think in that case the guidelines allow for the package to use the bundled, customized version of "six".

Comment 5 Fedora Update System 2016-06-28 17:35:02 UTC
python-stuf-0.9.16-7.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-88d1dd43df

Comment 6 Fedora Update System 2016-06-28 17:35:10 UTC
python-stuf-0.9.16-7.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-68834a8bf9

Comment 7 Fedora Update System 2016-06-28 17:35:15 UTC
python-stuf-0.9.16-7.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-828ce6b5a6

Comment 8 Fedora Update System 2016-06-28 17:35:20 UTC
python-stuf-0.9.16-7.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a931c8f9c3

Comment 9 Fedora Update System 2016-06-29 18:26:41 UTC
python-stuf-0.9.16-7.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-68834a8bf9

Comment 10 Fedora Update System 2016-06-29 21:50:12 UTC
python-stuf-0.9.16-7.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-828ce6b5a6

Comment 11 Fedora Update System 2016-06-29 22:21:02 UTC
python-stuf-0.9.16-7.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a931c8f9c3

Comment 12 Fedora Update System 2016-06-29 22:56:07 UTC
python-stuf-0.9.16-7.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-88d1dd43df

Comment 13 Ling Li 2016-07-05 04:12:42 UTC
Thanks for fixing the "six" issue.  

There is one more minor issue for EL 7.  This version of python-stuf states its requirement in /usr/lib/python2.7/site-packages/stuf-0.9.16-py2.7.egg-info/requires.txt "parse>=1.6.6" while EPEL only provides 1.6.4.  So when it is used, one get the error message below:

VersionConflict: (parse 1.6.4 (/usr/lib/python2.7/site-packages), Requirement.parse('parse>=1.6.6'))

There are two fixes: 

a) ignore that requirement (%exclude %{python2_sitelib}/%{modname}-%{version}*/requires*) and add to the RPM spec "Requires:           python-parse >= 1.6.4"

b) Provides python-parse 1.6.6 in EPEL 7.

It is actually safe (from my experience) to use 1.6.4 instead of 1.6.6.

Comment 14 Ralph Bean 2016-07-05 14:23:22 UTC
Ling, thanks!  Can you file a separate bug for that issue?

Comment 15 Fedora Update System 2016-07-05 14:47:05 UTC
python-stuf-0.9.16-8.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-48b9b3921e

Comment 16 Fedora Update System 2016-07-06 07:19:26 UTC
python-stuf-0.9.16-8.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-48b9b3921e

Comment 17 Ling Li 2016-07-07 23:18:48 UTC
Thanks!  The new update (python-stuf-0.9.16-8.el7) works fine for me.

Comment 18 Fedora Update System 2016-07-10 05:57:55 UTC
python-stuf-0.9.16-7.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2016-07-12 23:51:53 UTC
python-stuf-0.9.16-7.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2016-07-13 06:19:31 UTC
python-stuf-0.9.16-7.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 21 Fedora Update System 2016-07-27 19:18:31 UTC
python-stuf-0.9.16-8.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.