Skip to content

Commit 0f11e9c

Browse files
Merge pull request #1246 from mattwthompson/no-importlib-backport
Drop `importlib.resources` backport
2 parents 8305c20 + 73963db commit 0f11e9c

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

docs/docs-env.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ channels:
55
dependencies:
66
- ele
77
- numpy
8-
- importlib_resources
98
- python=3.11
109
- ipython
1110
- boltons

environment-dev.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ dependencies:
4040
- symengine
4141
- python-symengine
4242
- hoomd>=4.0,<5.0
43-
- importlib_resources
4443
- pip:
4544
- git+https://github.com/mosdef-hub/gmso.git@main
4645
- git+https://github.com/mosdef-hub/foyer.git@main

environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ dependencies:
1414
- scipy
1515
- networkx
1616
- treelib
17-
- importlib_resources

mbuild/utils/io.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
import sys
2727
import textwrap
2828
import warnings
29+
from importlib.resources import files
2930
from unittest import SkipTest
3031

31-
import importlib_resources as resources
32-
3332

3433
class DelayImportError(ImportError, SkipTest):
3534
"""Error to allow better import handling."""
@@ -362,8 +361,8 @@ def get_fn(name):
362361
name : str
363362
Name of the file to load (with respect to the reference/ folder).
364363
"""
365-
fn = resources.files("mbuild").joinpath("utils", "reference", name)
366-
# fn = resource_filename("mbuild", os.path.join("utils", "reference", name))
364+
fn = files("mbuild").joinpath("utils", "reference", name)
365+
367366
if not os.path.exists(fn):
368367
raise IOError(f"Sorry! {fn} does not exists.")
369368
return str(fn)

0 commit comments

Comments
 (0)