RuntimeWarning generated by is_compatible()

Bug #1706394 reported by John L. Villalovos
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo.utils
Fix Released
Undecided
John L. Villalovos

Bug Description

In Ironic during a run of: $ tox -e py35

We see 11,000+ RuntimeWarnings like this:

  RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.'

This is caused by this line:
https://github.com/openstack/oslo.utils/blob/dd1ceea294b36dc7f3e4546498b092c3fd13875f/oslo_utils/versionutils.py#L45

When it tries to index the value it causes the __iter__ operator to run and then the above RuntimeWarning is generated.

Changed in oslo.utils:
assignee: nobody → John L. Villalovos (happycamp)
status: New → In Progress
Revision history for this message
John L. Villalovos (happycamp) wrote :

Fix proposed:

https://review.openstack.org/486796 Prevent deprecation error messages from pkg_resources

summary: - RuntimeWarning generated by is_compatbile())
+ RuntimeWarning generated by is_compatbile()
summary: - RuntimeWarning generated by is_compatbile()
+ RuntimeWarning generated by is_compatible()
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.utils (master)

Reviewed: https://review.openstack.org/486796
Committed: https://git.openstack.org/cgit/openstack/oslo.utils/commit/?id=47b22208eaa6be2c0352514a66926dd2baeaa025
Submitter: Jenkins
Branch: master

commit 47b22208eaa6be2c0352514a66926dd2baeaa025
Author: John L. Villalovos <email address hidden>
Date: Mon Jul 24 17:14:58 2017 -0700

    Prevent deprecation error messages from pkg_resources

    Currently pkg_resources is creating this warning message:

        RuntimeWarning: You have iterated over the result of
        pkg_resources.parse_version. This is a legacy behavior which is
        inconsistent with the new version class introduced in setuptools
        8.0. In most cases, conversion to a tuple is unnecessary. For
        comparison of versions, sort the Version instances directly. If
        you have another use case requiring the tuple, please file a bug
        with the setuptools project describing that need.

    Get the major_version directly from the version string passed in
    instead so that the warning message is not raised.

    Closes-Bug: #1706394
    Change-Id: I663ed579c27e48a34fdd9565037110a43e5b5587

Changed in oslo.utils:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.utils 3.29.0

This issue was fixed in the openstack/oslo.utils 3.29.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.utils (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/554053

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.utils (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/554338

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.utils (stable/pike)

Reviewed: https://review.openstack.org/554053
Committed: https://git.openstack.org/cgit/openstack/oslo.utils/commit/?id=464a73d87f34eb2055c5ebfd1c3dcb418b4e75dc
Submitter: Zuul
Branch: stable/pike

commit 464a73d87f34eb2055c5ebfd1c3dcb418b4e75dc
Author: John L. Villalovos <email address hidden>
Date: Mon Jul 24 17:14:58 2017 -0700

    Prevent deprecation error messages from pkg_resources

    Currently pkg_resources is creating this warning message:

        RuntimeWarning: You have iterated over the result of
        pkg_resources.parse_version. This is a legacy behavior which is
        inconsistent with the new version class introduced in setuptools
        8.0. In most cases, conversion to a tuple is unnecessary. For
        comparison of versions, sort the Version instances directly. If
        you have another use case requiring the tuple, please file a bug
        with the setuptools project describing that need.

    Get the major_version directly from the version string passed in
    instead so that the warning message is not raised.

    Depends-on: https://review.openstack.org/554318/

    Closes-Bug: #1706394
    Change-Id: I663ed579c27e48a34fdd9565037110a43e5b5587
    (cherry picked from commit 47b22208eaa6be2c0352514a66926dd2baeaa025)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.utils (stable/ocata)

Reviewed: https://review.openstack.org/554338
Committed: https://git.openstack.org/cgit/openstack/oslo.utils/commit/?id=229a1690bbfe554e84e63bff9e7e3ce3bef1126f
Submitter: Zuul
Branch: stable/ocata

commit 229a1690bbfe554e84e63bff9e7e3ce3bef1126f
Author: John L. Villalovos <email address hidden>
Date: Mon Jul 24 17:14:58 2017 -0700

    Prevent deprecation error messages from pkg_resources

    Currently pkg_resources is creating this warning message:

        RuntimeWarning: You have iterated over the result of
        pkg_resources.parse_version. This is a legacy behavior which is
        inconsistent with the new version class introduced in setuptools
        8.0. In most cases, conversion to a tuple is unnecessary. For
        comparison of versions, sort the Version instances directly. If
        you have another use case requiring the tuple, please file a bug
        with the setuptools project describing that need.

    Get the major_version directly from the version string passed in
    instead so that the warning message is not raised.

    Closes-Bug: #1706394
    Change-Id: I663ed579c27e48a34fdd9565037110a43e5b5587
    (cherry picked from commit 47b22208eaa6be2c0352514a66926dd2baeaa025)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.utils 3.22.2

This issue was fixed in the openstack/oslo.utils 3.22.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.utils 3.28.2

This issue was fixed in the openstack/oslo.utils 3.28.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.