)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"a6882df4c7a34ec724df9c97c5de0a8cc69cbcc7","unresolved":true,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"If this occurs, you can fall back to a more modern approach using"},{"line_number":16,"context_line":"importlib.metadata, which tends to handle normalized package names"},{"line_number":17,"context_line":"more reliably."},{"line_number":18,"context_line":"This method is also more lightweight and better aligned with current"},{"line_number":19,"context_line":"Python packaging standards."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7acdc44e_949f3a9f","line":17,"updated":"2025-05-06 16:07:08.000000000","message":"I\u0027m not quite sure we are checking the same thing:\n\n* pkg_resource.require(\u003cname\u003e) gives back a list of packages that are required by package \u003cname\u003e to be installed, with installed versions.\n\n* importlib.metadata.version(\u003cname\u003e) gives back the installed version of the package \u003cname\u003e itself. but i might be missing something.","commit_id":"6efd7b7a2b4eeeda8016152cf199008c5d912ce4"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":13252,"name":"Dr. Jens Harbott","display_name":"Jens Harbott (frickler)","email":"frickler@offenerstapel.de","username":"jrosenboom"},"change_message_id":"3e9051de5fdc2a62c2a97cb8e99e92ba712e6eed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"413d2611_7443b1ff","updated":"2025-05-16 11:39:21.000000000","message":"the oslo.utils release is 1 month old now, let\u0027s just move along with this now, we can make amendmends later if needed","commit_id":"6efd7b7a2b4eeeda8016152cf199008c5d912ce4"}],"openstack_requirements/cmds/check_conflicts.py":[{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"94aba898927cd7462f51d6d03671d5faf1b0a98c","unresolved":true,"context_lines":[{"line_number":58,"context_line":"            # If it occurs use an alternative method using importlib."},{"line_number":59,"context_line":"            for req, _ in spec_list:"},{"line_number":60,"context_line":"                if req.markers in [\"\", pyver]:"},{"line_number":61,"context_line":"                    pkg_ver \u003d metadata.version(name)"},{"line_number":62,"context_line":"                    required_pkg_ver \u003d req.specifiers.replace(\"\u003d\u003d\u003d\", \"\")"},{"line_number":63,"context_line":"                    if not pkg_ver \u003d\u003d required_pkg_ver:"},{"line_number":64,"context_line":"                        raise ValueError("}],"source_content_type":"text/x-python","patch_set":2,"id":"fb9786c3_b5b69655","line":61,"updated":"2025-05-06 16:19:25.000000000","message":"as i wrote in my previous comment, this is not testing the same if i understand well.\n\nwe probably have to replace the above \u0027pkg_resources.require(name)\u0027 with \u0027metadata.requires(name)\u0027 for the same result we wanted to test originally.","commit_id":"6efd7b7a2b4eeeda8016152cf199008c5d912ce4"},{"author":{"_account_id":16207,"name":"ribaudr","display_name":"uggla","email":"rene.ribaud@gmail.com","username":"uggla","status":"Red Hat"},"change_message_id":"4044b8221e073258d0d1fd2395a491fd69324f83","unresolved":true,"context_lines":[{"line_number":58,"context_line":"            # If it occurs use an alternative method using importlib."},{"line_number":59,"context_line":"            for req, _ in spec_list:"},{"line_number":60,"context_line":"                if req.markers in [\"\", pyver]:"},{"line_number":61,"context_line":"                    pkg_ver \u003d metadata.version(name)"},{"line_number":62,"context_line":"                    required_pkg_ver \u003d req.specifiers.replace(\"\u003d\u003d\u003d\", \"\")"},{"line_number":63,"context_line":"                    if not pkg_ver \u003d\u003d required_pkg_ver:"},{"line_number":64,"context_line":"                        raise ValueError("}],"source_content_type":"text/x-python","patch_set":2,"id":"50d48a41_04adb205","line":61,"in_reply_to":"1b0d2297_d4343def","updated":"2025-05-07 07:47:14.000000000","message":"I realize I was too restrictive in my previous message.\nI believe we should phase out pkg_resources and replace it with importlib and packaging, as this seems to be the most appropriate approach for modern Python.\nHowever, this would be a more ambitious second patch, since pkg_resources is used in many places throughout the repository.\n\nThat said, I’d be happy to help move in that direction if we agree it’s the right path forward.","commit_id":"6efd7b7a2b4eeeda8016152cf199008c5d912ce4"},{"author":{"_account_id":16207,"name":"ribaudr","display_name":"uggla","email":"rene.ribaud@gmail.com","username":"uggla","status":"Red Hat"},"change_message_id":"7b1c914d5a44c24f962191281bc62d1f31f5365b","unresolved":true,"context_lines":[{"line_number":58,"context_line":"            # If it occurs use an alternative method using importlib."},{"line_number":59,"context_line":"            for req, _ in spec_list:"},{"line_number":60,"context_line":"                if req.markers in [\"\", pyver]:"},{"line_number":61,"context_line":"                    pkg_ver \u003d metadata.version(name)"},{"line_number":62,"context_line":"                    required_pkg_ver \u003d req.specifiers.replace(\"\u003d\u003d\u003d\", \"\")"},{"line_number":63,"context_line":"                    if not pkg_ver \u003d\u003d required_pkg_ver:"},{"line_number":64,"context_line":"                        raise ValueError("}],"source_content_type":"text/x-python","patch_set":2,"id":"1b0d2297_d4343def","line":61,"in_reply_to":"6cc60b5a_2f0fe45a","updated":"2025-05-07 07:16:48.000000000","message":"Oh! I guess you are one step ahead of me, Elod.\nMy goal with the patch was to provide a workaround to allow merging https://review.opendev.org/c/openstack/releases/+/947847.\nRight now, it only checks that the installed packages match the versions from upper-constraints.txt if pkg_resources.require() fails to resolve the package name due to the package name normalization issue. At the moment, this only affects Python 3.8.\n\nTo my mind, this is a first patch, but we’ll need a second, more elaborate one to replace the pkg_resources.require() method, as it will no longer be supported in Python 3.13, as I understand from Sean.","commit_id":"6efd7b7a2b4eeeda8016152cf199008c5d912ce4"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"e0ab5e62dc4329d16dc04cbb17cfbd9acbb137a6","unresolved":true,"context_lines":[{"line_number":58,"context_line":"            # If it occurs use an alternative method using importlib."},{"line_number":59,"context_line":"            for req, _ in spec_list:"},{"line_number":60,"context_line":"                if req.markers in [\"\", pyver]:"},{"line_number":61,"context_line":"                    pkg_ver \u003d metadata.version(name)"},{"line_number":62,"context_line":"                    required_pkg_ver \u003d req.specifiers.replace(\"\u003d\u003d\u003d\", \"\")"},{"line_number":63,"context_line":"                    if not pkg_ver \u003d\u003d required_pkg_ver:"},{"line_number":64,"context_line":"                        raise ValueError("}],"source_content_type":"text/x-python","patch_set":2,"id":"6cc60b5a_2f0fe45a","line":61,"in_reply_to":"fb9786c3_b5b69655","updated":"2025-05-06 17:01:33.000000000","message":"(and a side note, that while pkg_resources.require(\u003cname\u003e) drops ContextualVersionConflict error if a dependency\u0027s version does not met the required specifiers, metadata.requires(\u003cname\u003e) just gives back the list [1]. in cases where the requirements are all met, pkg_resources.require would just give back the list the same way as metadata.requires, without any error.\n\n\n[1] an example where i\u0027ve installed oslo.log (which installs all its dependencies) and then downgraded oslo.utils to does not met the requirement that oslo.log needs:\n\npkg_resources.require raises the error:\n\n    \u003e\u003e\u003e pkg_resources.require(\u0027oslo.log\u0027)\n    Traceback (most recent call last):\n      File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n      File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 901, in require\n        needed \u003d self.resolve(parse_requirements(requirements))\n      File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 792, in resolve\n        raise VersionConflict(dist, req).with_context(dependent_req)\n    pkg_resources.ContextualVersionConflict: (oslo.utils 3.35.0 (/home/stack/.local/lib/python3.8/site-packages), Requirement.parse(\u0027oslo.utils\u003e\u003d3.36.0\u0027), {\u0027oslo.log\u0027})\n\n\nmetadata.requires just gives back the list and does not say anything about the version conflict:\n\n    \u003e\u003e\u003e metadata.requires(\u0027oslo.utils\u0027)\n    [\u0027pbr (!\u003d2.1.0,\u003e\u003d2.0.0)\u0027, \u0027six (\u003e\u003d1.10.0)\u0027, \u0027iso8601 (\u003e\u003d0.1.11)\u0027, \u0027oslo.i18n (\u003e\u003d3.15.3)\u0027, \u0027monotonic (\u003e\u003d0.6)\u0027, \u0027pytz (\u003e\u003d2013.6)\u0027, \u0027netaddr (\u003e\u003d0.7.18)\u0027, \u0027netifaces (\u003e\u003d0.10.\n    4)\u0027, \u0027debtcollector (\u003e\u003d1.2.0)\u0027, \u0027pyparsing (\u003e\u003d2.1.0)\u0027, \"funcsigs (\u003e\u003d1.0.0); (python_version\u003d\u003d\u00272.7\u0027 or python_version\u003d\u003d\u00272.6\u0027)\"]\n)","commit_id":"6efd7b7a2b4eeeda8016152cf199008c5d912ce4"}]}
