Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: pkg_resources deprecation #70

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions q2_diversity_lib/examples.py
Original file line number Diff line number Diff line change
@@ -7,15 +7,17 @@
# ----------------------------------------------------------------------------

import biom
import importlib.resources
import numpy as np
import pkg_resources

from qiime2 import Artifact


def get_test_data_path(filename):
return pkg_resources.resource_filename('q2_diversity_lib.tests',
f'data/{filename}')
return (
importlib.resources.files('q2_diversity_lib') /
'tests' / 'data' / filename
)


s_ids_1 = ['S1', 'S2', 'S3', 'S4', 'S5']
6 changes: 2 additions & 4 deletions q2_diversity_lib/tests/test_beta.py
Original file line number Diff line number Diff line change
@@ -5,14 +5,13 @@
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
import os
import importlib.resources
from subprocess import CalledProcessError

import numpy as np
import numpy.testing as npt
import biom
import skbio
import pkg_resources

from qiime2.plugin.testing import TestPluginBase
from qiime2 import Artifact
@@ -322,8 +321,7 @@ def setUp(self):

# checking parity with the unifrac.meta tests
def unifrac_data(fn):
path = os.path.join('data', fn)
return pkg_resources.resource_filename('unifrac.tests', path)
return importlib.resources.files('unifrac') / 'tests' / 'data' / fn

self.tables = [
Artifact.import_data('FeatureTable[Frequency]',