Skip to content

Commit

Permalink
Merge pull request #114 from Rubo3/patch-1
Browse files Browse the repository at this point in the history
Use importlib.resources instead of deprecated pkg_resources
  • Loading branch information
tybug authored Sep 7, 2023
2 parents c0d48c1 + 1d74cb5 commit 040e17f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions slider/example_data/beatmaps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pkg_resources import resource_filename
from pathlib import Path

from slider import Beatmap

Expand All @@ -11,12 +11,7 @@ def example_beatmap(name):
name : str
The name of the example file to open.
"""
return Beatmap.from_path(
resource_filename(
__name__,
name,
),
)
return Beatmap.from_path(Path(__file__).parent / name)


_sendan_life_versions = frozenset({
Expand Down
9 changes: 2 additions & 7 deletions slider/example_data/collections/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pkg_resources import resource_filename
from pathlib import Path

from slider import CollectionDB

Expand All @@ -11,12 +11,7 @@ def example_collection(name):
name : str
The name of the example file to open.
"""
return CollectionDB.from_path(
resource_filename(
__name__,
name,
),
)
return CollectionDB.from_path(Path(__file__).parent / name)


def test_db():
Expand Down

0 comments on commit 040e17f

Please sign in to comment.