[med-svn] [Git][med-team/python-pbcommand][master] * Remove usages of pkg_resources (Thanks to Vladimir Petko)

Andreas Tille (@tille) gitlab at salsa.debian.org
Sun Feb 16 13:33:52 GMT 2025



Andreas Tille pushed to branch master at Debian Med / python-pbcommand


Commits:
74341631 by Andreas Tille at 2025-02-16T14:33:42+01:00
* Remove usages of pkg_resources (Thanks to Vladimir Petko)
  Closes: #1093231
* Revert explicit dependency from python3-pkg-resources

- - - - -


5 changed files:

- debian/changelog
- debian/control
- + debian/patches/remove-pkg-resources.patch
- debian/patches/series
- debian/tests/control


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+python-pbcommand (2.1.1+git20220616.3f2e6c2-5) UNRELEASED; urgency=medium
+
+  * Remove usages of pkg_resources (Thanks to Vladimir Petko)
+    Closes: #1093231
+  * Revert explicit dependency from python3-pkg-resources
+
+ -- Andreas Tille <tille at debian.org>  Sun, 16 Feb 2025 14:31:46 +0100
+
 python-pbcommand (2.1.1+git20220616.3f2e6c2-4) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -26,7 +26,6 @@ Package: python3-pbcommand
 Architecture: all
 Depends: ${misc:Depends},
          ${python3:Depends},
-         python3-pkg-resources,
          python3-avro,
          python3-numpy
 Recommends: python3-pbcore


=====================================
debian/patches/remove-pkg-resources.patch
=====================================
@@ -0,0 +1,25 @@
+Description: Remove usages of pkg_resources
+ pkg_resources are no longer available in Python 3.12 due to setuptools
+ removal from the default installation. This patch replaces the usages of
+ pkg_resources with importlib.resources.
+Author: Vladimir Petko <vladimir.petko at canonical.com>
+Bug: https://github.com/PacificBiosciences/pbcommand/pull/191
+Bug-Debian: https://bugs.debian.org/1093231
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-pbcommand/+bug/2095045
+Last-Update: 2025-01-16
+
+--- a/pbcommand/__init__.py
++++ b/pbcommand/__init__.py
+@@ -1,9 +1,9 @@
+-import pkg_resources
++from importlib.metadata import Distribution, PackageNotFoundError
+ import sys
+
+ try:
+-    __VERSION__ = pkg_resources.get_distribution('pbcommand').version
+-except Exception:
++    __VERSION__ = Distribution.from_name('pbcommand').version
++except PackageNotFoundError:
+     __VERSION__ = '2.4.0'
+
+ VERSION = (int(x) for x in __VERSION__.split('.'))


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 python3.patch
 fix_version.patch
+remove-pkg-resources.patch


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,7 @@
 Tests: run-unit-test
 Depends: @, python3-pytest, python3-pytest-xdist, python3-pytest-cov, python3-pbcore
 Restrictions: allow-stderr, skip-not-installable
+
+Test-Command: python3 -c "import pbcommand"
+Depends: @
+Restrictions: allow-stderr, skip-not-installable



View it on GitLab: https://salsa.debian.org/med-team/python-pbcommand/-/commit/743416313dda8d81a4c69388d481b7dfad5eef27

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-pbcommand/-/commit/743416313dda8d81a4c69388d481b7dfad5eef27
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250216/d9bf382a/attachment-0001.htm>


More information about the debian-med-commit mailing list