Bug #66201
closedprometheus module uses "from pkg_resources import packaging", should use "import packaging"
0%
Description
Noticed first on a readthedocs.org build, which installed setuptools v70.0.0 (released yesterday, 21May2024) and broke the docs build because packaging was apparently removed from pkg_resources. However, there's a standalone module "packaging" that seems to contain the required version parsing code. I'm sure this will break the prometheus module at runtime as well.
prometheus/module.py should probably be doing "import packaging" (with possible updates to requirements.txt/distro package dependencies).
DM Updated by Dan Mick over 2 years ago
There are also other usages of pkg_resources, itself now issuing deprecation warnings, that should probably get reexamined; from a quick grep:
$ git grep pkg_resources
src/ceph-volume/ceph_volume/main.py:import pkg_resources
src/ceph-volume/ceph_volume/main.py: entry_points = pkg_resources.iter_entry_points(group=group)
src/cephadm/cephadmlib/daemons/iscsi.py: "import pkg_resources; print(pkg_resources.require('ceph_iscsi')[0].version)",
src/mypy-constrains.txt:types-pkg_resources==0.1.3
src/pybind/mgr/dashboard/cherrypy_backports.py:from pkg_resources import parse_version
src/pybind/mgr/prometheus/module.py:from pkg_resources import packaging # type: ignore
src/pybind/mgr/tox.ini: types-pkg_resources
KC Updated by Kefu Chai over 2 years ago
created https://github.com/ceph/ceph/pull/57650 to address the issue in ceph-volume .
KC Updated by Kefu Chai over 2 years ago ยท Edited
KC Updated by Kefu Chai over 2 years ago
KC Updated by Kefu Chai over 2 years ago
- Status changed from New to Fix Under Review
- Assignee set to Kefu Chai
- Pull request ID set to 57700
KC Updated by Kefu Chai over 2 years ago
- Status changed from Fix Under Review to Resolved
DM Updated by Dan Mick over 2 years ago
- Backport set to quincy reef squid
DM Updated by Dan Mick over 2 years ago
- Backport changed from quincy reef squid to quincy,reef,squid
LU Updated by Leonid Usov over 2 years ago
- Status changed from Resolved to Pending Backport
Updating the state to backport pending for the bot to generate the required tickets
UB Updated by Upkeep Bot over 2 years ago
- Copied to Backport #66412: quincy: prometheus module uses "from pkg_resources import packaging", should use "import packaging" added
UB Updated by Upkeep Bot over 2 years ago
- Copied to Backport #66413: squid: prometheus module uses "from pkg_resources import packaging", should use "import packaging" added
UB Updated by Upkeep Bot over 2 years ago
- Copied to Backport #66414: reef: prometheus module uses "from pkg_resources import packaging", should use "import packaging" added
UB Updated by Upkeep Bot over 1 year ago
- Merge Commit set to 700916cbab03a46d56635ef66b697b1f84f361b0
- Fixed In set to v19.3.0-2410-g700916cbab0
- Upkeep Timestamp set to 2025-07-08T22:38:25+00:00
UB Updated by Upkeep Bot over 1 year ago
- Fixed In changed from v19.3.0-2410-g700916cbab0 to v19.3.0-2410-g700916cbab03
- Upkeep Timestamp changed from 2025-07-08T22:38:25+00:00 to 2025-07-14T15:46:58+00:00
UB Updated by Upkeep Bot over 1 year ago
- Fixed In changed from v19.3.0-2410-g700916cbab03 to v19.3.0-2410-g700916cbab
- Upkeep Timestamp changed from 2025-07-14T15:46:58+00:00 to 2025-07-14T21:37:59+00:00
UB Updated by Upkeep Bot about 1 year ago
- Released In set to v20.2.0~2821
- Upkeep Timestamp changed from 2025-07-14T21:37:59+00:00 to 2025-11-01T00:57:15+00:00