Your message dated Thu, 27 Feb 2025 22:27:50 +0000
with message-id <[email protected]>
and subject line Bug#1093230: fixed in python-pbcore 2.1.2+dfsg-11
has caused the Debian Bug report #1093230,
regarding python-pbcore: unable to import pbcore with python default 3.13
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1093230: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093230
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-pbcore
Version: 2.1.2+dfsg-10
Severity: important
Tags: patch
User: [email protected]
Usertags: origin-ubuntu plucky ubuntu-patch

Dear Maintainer,

Adding a simple autopkgtest `python -c "import pbcore"` fails with the
following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import pbcore
  File "/tmp/autopkgtest.Mysbkx/build.qos/real-tree/pbcore/__init__.py", line
1, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

This is due to python 3.12 removing setuptools from the default installation.

In Ubuntu, the attached patch was applied to achieve the following:

  * d/p/remove-pkg-resources.patch: replace the usages of pkg_resources
    with importlib.resources for Python 3.13 compatibility (LP: #2095040).
  * d/t/control: add smoke test.


Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers oracular-updates
  APT policy: (500, 'oracular-updates'), (500, 'oracular-security'), (500, 
'oracular'), (100, 'oracular-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.11.0-13-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru python-pbcore-2.1.2+dfsg/debian/patches/remove-pkg-resources.patch 
python-pbcore-2.1.2+dfsg/debian/patches/remove-pkg-resources.patch
--- python-pbcore-2.1.2+dfsg/debian/patches/remove-pkg-resources.patch  
1970-01-01 12:00:00.000000000 +1200
+++ python-pbcore-2.1.2+dfsg/debian/patches/remove-pkg-resources.patch  
2025-01-15 16:11:18.000000000 +1300
@@ -0,0 +1,116 @@
+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 <[email protected]>
+Bug: https://github.com/PacificBiosciences/pbcore/pull/126
+Bug-Ubuntu: 
https://bugs.launchpad.net/ubuntu/+source/python-pbcore/+bug/2095040
+Last-Update: 2025-01-15
+
+--- a/pbcore/data/datasets/__init__.py
++++ b/pbcore/data/datasets/__init__.py
+@@ -1,7 +1,7 @@
+ """Doctest resources"""
+ 
+ import os
+-from pkg_resources import Requirement, resource_filename
++from importlib import resources
+ 
+ XML_FILES = ["alignment.dataset.xml",  # 0
+              "barcode.dataset.xml",
+@@ -33,8 +33,10 @@
+ 
+ 
+ def _getAbsPath(fname):
+-    return resource_filename(Requirement.parse('pbcore'),
+-                             'pbcore/data/datasets/%s' % fname)
++    with resources.as_file(
++        resources.files('pbcore') /
++            'data/datasets' / fname) as ret:
++        return str(ret)
+ 
+ 
+ def getXml(no=0):
+--- a/pbcore/data/__init__.py
++++ b/pbcore/data/__init__.py
+@@ -1,4 +1,4 @@
+-from pkg_resources import Requirement, resource_filename
++from importlib import resources
+ 
+ MOVIE_NAME_14 = 
"m110818_075520_42141_c100129202555500000315043109121112_s1_p0"
+ MOVIE_NAME_20 = 
"m130522_092457_42208_c100497142550000001823078008081323_s1_p0"
+@@ -9,7 +9,10 @@
+ 
+ 
+ def _getAbsPath(fname):
+-    return resource_filename(Requirement.parse('pbcore'), 'pbcore/data/%s' % 
fname)
++    with resources.as_file(
++       resources.files('pbcore') /
++            'data' / fname) as ret:
++        return str(ret)
+ 
+ 
+ def getCCSBAM():
+--- a/pbcore/__init__.py
++++ b/pbcore/__init__.py
+@@ -1,6 +1,6 @@
+-import pkg_resources
++from importlib.metadata import Distribution, PackageNotFoundError
+ 
+ try:
+-    __VERSION__ = pkg_resources.get_distribution('pbcore').version
+-except Exception:
++    __VERSION__ = Distribution.from_name('pbcore').version
++except PackageNotFoundError:
+     __VERSION__ = 'unknown'
+--- a/pbcore/chemistry/chemistry.py
++++ b/pbcore/chemistry/chemistry.py
+@@ -6,7 +6,7 @@
+ import xml.etree.ElementTree as ET
+ import os.path
+ 
+-from pkg_resources import Requirement, resource_filename
++from importlib import resources
+ 
+ 
+ class ChemistryLookupError(Exception):
+@@ -35,12 +35,16 @@
+ 
+ def _loadBarcodeMappings():
+     try:
+-        mappingFname = resource_filename(Requirement.parse(
+-        'pbcore'), 'pbcore/chemistry/resources/mapping.xml')
++        mappingFnameContext = resources.as_file(
++            resources.files('pbcore') /
++                'chemistry/resources/mapping.xml')
++        with mappingFnameContext as mappingFname:
++            mappings = _loadBarcodeMappingsFromFile(mappingFname)
+     except:
+         mappingFname = os.path.join(os.path.dirname(__file__),
+-        'resources/mapping.xml')
+-    mappings = _loadBarcodeMappingsFromFile(mappingFname)
++            'resources/mapping.xml')
++        mappings = _loadBarcodeMappingsFromFile(mappingFname)
++
+     updMappingDir = os.getenv("SMRT_CHEMISTRY_BUNDLE_DIR")
+     if updMappingDir:
+         import logging
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -11,12 +11,13 @@
+ # All configuration values have a default; values that are commented out
+ # serve to show the default.
+ 
+-import pkg_resources
+ import sys, os
+ 
++from importlib.metadata import Distribution, PackageNotFoundError
++
+ try:
+-    __VERSION__ = pkg_resources.get_distribution('pbcore').version
+-except Exception:
++    __VERSION__ = Distribution.from_name('pbcore').version
++except PackageNotFoundError:
+     __VERSION__ = 'unknown'
+ 
+ 
diff -Nru python-pbcore-2.1.2+dfsg/debian/patches/series 
python-pbcore-2.1.2+dfsg/debian/patches/series
--- python-pbcore-2.1.2+dfsg/debian/patches/series      2024-12-17 
06:22:11.000000000 +1300
+++ python-pbcore-2.1.2+dfsg/debian/patches/series      2025-01-15 
16:11:18.000000000 +1300
@@ -4,3 +4,4 @@
 seek-curdir-for-xml.patch
 numpy_1.24.patch
 no-intersphinx.patch
+remove-pkg-resources.patch
diff -Nru python-pbcore-2.1.2+dfsg/debian/tests/control 
python-pbcore-2.1.2+dfsg/debian/tests/control
--- python-pbcore-2.1.2+dfsg/debian/tests/control       2024-12-17 
06:22:11.000000000 +1300
+++ python-pbcore-2.1.2+dfsg/debian/tests/control       2025-01-15 
16:11:18.000000000 +1300
@@ -2,3 +2,8 @@
 Depends: @, python3-pytest, python3-pytest-runner, python3-pytest-xdist, 
python3-pytest-cov
 Restrictions: allow-stderr
 Architecture: amd64 arm64 ppc64el
+
+Test-Command: python3 -c "import pbcore"
+Depends: @
+Restrictions: allow-stderr
+Architecture: amd64 arm64 ppc64el

--- End Message ---
--- Begin Message ---
Source: python-pbcore
Source-Version: 2.1.2+dfsg-11
Done: Étienne Mollier <[email protected]>

We believe that the bug you reported is fixed in the latest version of
python-pbcore, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Étienne Mollier <[email protected]> (supplier of updated python-pbcore 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 27 Feb 2025 22:38:34 +0100
Source: python-pbcore
Architecture: source
Version: 2.1.2+dfsg-11
Distribution: unstable
Urgency: medium
Maintainer: Debian Med Packaging Team 
<[email protected]>
Changed-By: Étienne Mollier <[email protected]>
Closes: 1089095 1093230 1095090
Changes:
 python-pbcore (2.1.2+dfsg-11) unstable; urgency=medium
 .
   [ Andreas Tille ]
   * d/p/remove-pkg-resources.patch: replace the usages of pkg_resources
     with importlib.resources for Python 3.13 compatibility (Thanks for the
     patch to Vladimir Petko)
     Closes: #1093230 (LP: #2095040).
   * d/t/control: add smoke test.
   * Make the build reproducible (Thanks for the patch to Chris Lamb)
     Closes: #1089095
 .
   [ Étienne Mollier ]
   * numpy2.patch: new: workaround overflow errors with numpy 2.
     (Closes: #1095090)
   * d/control: declare compliance to standards version 4.7.2.
Checksums-Sha1:
 f6ca92f8eaeb3351d785cfedbd25975d221d6c7d 2810 python-pbcore_2.1.2+dfsg-11.dsc
 516cf28f1f52a067af86ba4991c6b7e1041c30d8 62600 
python-pbcore_2.1.2+dfsg-11.debian.tar.xz
Checksums-Sha256:
 0f986cf420b135c31d8b96fbf659d31198707958279920433692fc8aa4a42fd1 2810 
python-pbcore_2.1.2+dfsg-11.dsc
 7198246bf05ebbce34deb89a2dcfbc2c9c6334f216bf158c1cd13dbf14bdf623 62600 
python-pbcore_2.1.2+dfsg-11.debian.tar.xz
Files:
 a57f33e77dde6883f4457d4b28ebad20 2810 python optional 
python-pbcore_2.1.2+dfsg-11.dsc
 c4759ec69d89bceac5f1d16601c8db17 62600 python optional 
python-pbcore_2.1.2+dfsg-11.debian.tar.xz


-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEj5GyJ8fW8rGUjII2eTz2fo8NEdoFAmfA3i0UHGVtb2xsaWVy
QGRlYmlhbi5vcmcACgkQeTz2fo8NEdrSJQ//W6o/b+YVgR79R/+wHJqu3NtoHbDO
LxNzTedcW04Qth7U8MPGMCljfMMGG30lWMgps4fNpncTTCCaAoLz6jfMlOr+QFI4
DcIaBT/L+sQosa0J+bYRdONwvYgs3XqnfhmsEjtAyf+z1GnbTDsFhyPPD9sWNT4L
qIussaqI3dnPhmoEQKQHhEkcZ6TNN6U3oQE8iwpLw8XgOPO+NYYk6+tu+FNYXTFS
O4CKdsUD4B3khIJUMocd2Tk357w7qPUbbJ0fJlgsY1qI0wy379iH4TQj1ZKBK94O
InRTnh273id/G1kzpg0XG/iLYALrCOZitvNA1Rmta57TrXLbD9UImmRTUiixB6qr
Hm/7j/ImgXG9qL5PPMsGcSuAmdMHOibUcwHLtvzZg0rFIxHeLHH4W02mNCHGI95G
HzYfUb+U1haoSZXY1kC4zObjVSe21S3Px49zGfQ7e2adH4KBXQMj+eXy24iFFArv
AcpRBOKrfJJrXIlgQdA6lE155CxLTy6TJQrJwqv2STtHxLzeUpqqS089l2WdY+B7
+a0eISy00z7fpgLlPkv9cxfTljzsAzOm8z7srot2t1wJxTsE9uCvQLKZ1OM94EsI
WIOT/+Tw7UfWIm1EMd8cwDIJ4SFTYCN/VdzcOlj557n/bA5t1kns2i7rgjptv3PB
UShOg4Wg4gdSt50=
=IR24
-----END PGP SIGNATURE-----

Attachment: pgp2MF7eHkA9e.pgp
Description: PGP signature


--- End Message ---

Reply via email to