Project

General

Profile

Actions

Bug #66201

closed
DM KC

prometheus module uses "from pkg_resources import packaging", should use "import packaging"

Bug #66201: prometheus module uses "from pkg_resources import packaging", should use "import packaging"

Added by Dan Mick over 2 years ago. Updated 7 months ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
prometheus module
Target version:
-
Due date:
% Done:

0%

Source:
Development
Backport:
quincy,reef,squid
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v19.3.0-2410-g700916cbab
Released In:
v20.2.0~2821
Upkeep Timestamp:
2025-11-01T00:57:15+00:00

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).


Related issues 3 (0 open — 3 closed)

Copied to mgr - Backport #66412: quincy: prometheus module uses "from pkg_resources import packaging", should use "import packaging"ResolvedAdam King

Actions
Copied to mgr - Backport #66413: squid: prometheus module uses "from pkg_resources import packaging", should use "import packaging"ResolvedAdam King

Actions
Copied to mgr - Backport #66414: reef: prometheus module uses "from pkg_resources import packaging", should use "import packaging"RejectedAdam King

Actions

DM Updated by Dan Mick over 2 years ago Actions #1

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 Actions #5

  • 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 Actions #6

  • Status changed from Fix Under Review to Resolved

DM Updated by Dan Mick over 2 years ago Actions #7

  • Backport set to quincy reef squid

DM Updated by Dan Mick over 2 years ago Actions #8

  • Backport changed from quincy reef squid to quincy,reef,squid

LU Updated by Leonid Usov over 2 years ago Actions #9

  • 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 Actions #10

  • 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 Actions #11

  • 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 Actions #12

  • 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 Actions #14

  • 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 Actions #15

  • 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 Actions #16

  • 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 Actions #17

  • 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

KC Updated by Kefu Chai 7 months ago Actions #18

  • Status changed from Pending Backport to Resolved
Actions

Also available in: PDF Atom