File: remove-pkg-resources.diff

package info (click to toggle)
pybel 0.15.5-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,504 kB
  • sloc: python: 29,392; javascript: 246; makefile: 226; sh: 20
file content (39 lines) | stat: -rw-r--r-- 1,295 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
28
29
30
31
32
33
34
35
36
37
38
39
Description: Remove python3-pkg-resources usage
 This patch removes the usage of the deprecated
 module python3-pkg-resources and replaces it
 with importlib
 .
 pybel (0.15.5-4) UNRELEASED; urgency=medium
 .
   [ Aryan Karamtoth ]
   * Team upload
   * Updated d/copyright years
   * Remove dependency on python3-pkg-resources (Closes: #1125817)
Author: Aryan Karamtoth <spaciouscoder78@disroot.org>
Forwarded: no
Last-Update: 2026-01-31

--- pybel-0.15.5.orig/src/pybel/io/api.py
+++ pybel-0.15.5/src/pybel/io/api.py
@@ -6,7 +6,7 @@ import os
 from typing import TextIO, Union
 
 from networkx.utils import open_file
-from pkg_resources import iter_entry_points
+from importlib.metadata import entry_points
 
 from ..struct import BELGraph
 
@@ -17,10 +17,10 @@ __all__ = [
 ]
 
 #: Mapping from extension to importer function
-IMPORTERS = {entry.name: entry.load() for entry in iter_entry_points(group="pybel.importer")}
+IMPORTERS = {entry.name: entry.load() for entry in entry_points(group="pybel.importer")}
 
 #: Mapping from extension to exporter function
-EXPORTERS = {entry.name: entry.load() for entry in iter_entry_points(group="pybel.exporter")}
+EXPORTERS = {entry.name: entry.load() for entry in entry_points(group="pybel.exporter")}
 
 
 class InvalidExtensionError(ValueError):