File: fix-pkg-resources.patch

package info (click to toggle)
python-pyfaidx 0.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 816 kB
  • sloc: python: 3,034; makefile: 15; sh: 6
file content (27 lines) | stat: -rw-r--r-- 744 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: pkg-resources only works once the package has been installed and breaks
 in-place testing. Workaround it by making it n/a if not found
Author: Nilesh Patra <nilesh@debian.org>
Forwarded: not-needed
Last-Update: 2022-02-17
--- a/pyfaidx/__init__.py
+++ b/pyfaidx/__init__.py
@@ -7,6 +7,7 @@ from __future__ import division
 
 import datetime
 import os
+import pkg_resources
 import re
 import string
 import sys
@@ -33,7 +34,10 @@ try:
 except ImportError:
     fsspec = None
 
-__version__ = get_distribution("pyfaidx").version
+try:
+    __version__ = get_distribution("pyfaidx").version
+except (ImportError, pkg_resources.DistributionNotFound):
+    __version__ = 'n/a'
 
 if sys.version_info > (3, ):
     buffer = memoryview