Skip to content

Commit d0eb7f5

Browse files
authored
MAINT: pkg_resources deprecation (#237)
1 parent f880f13 commit d0eb7f5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

q2_sample_classifier/tests/test_base_class.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# ----------------------------------------------------------------------------
88
import tempfile
9-
import pkg_resources
9+
import importlib
1010

1111
from qiime2.plugin.testing import TestPluginBase
1212

@@ -23,5 +23,4 @@ def tearDown(self):
2323
self.temp_dir.cleanup()
2424

2525
def get_data_path(self, filename):
26-
return pkg_resources.resource_filename(self.package,
27-
'data/%s' % filename)
26+
return importlib.resources.files(self.package) / 'data' / filename

q2_sample_classifier/utilities.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import pandas as pd
3333
import numpy as np
3434
import matplotlib.pyplot as plt
35-
import pkg_resources
35+
import importlib
3636
from scipy.sparse import issparse
3737
from scipy.stats import randint
3838
import biom
@@ -63,7 +63,7 @@
6363
}
6464

6565

66-
TEMPLATES = pkg_resources.resource_filename('q2_sample_classifier', 'assets')
66+
TEMPLATES = importlib.resources.files('q2_sample_classifier') / 'assets'
6767

6868

6969
def _extract_features(feature_data):

0 commit comments

Comments
 (0)