RuntimeWarning generated by is_compatible()

Bug #1706394 reported by John L. Villalovos on 2017-07-25
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo.utils
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
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()

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

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

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

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

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

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  Edit
Everyone can see this information.

Other bug subscribers