Skip to content

Commit

Permalink
Replace pkg_resources with importlib.resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jul 9, 2021
1 parent 17c12ce commit 55c798c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ testing =
pytest-enabler >= 1.0.1

# local
importlib_resources; python_version < "3.9"

docs =
# upstream
Expand Down
12 changes: 8 additions & 4 deletions tests/test_egg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
import shutil
import warnings

import pkg_resources
try:
from importlib.resources import files # type: ignore
except ImportError:
from importlib_resources import files # type: ignore

import pytest
from setuptools.command import egg_info

from setuptools_svn import svn_utils
from tests import environment
from tests.test_svn import needs_svn

ENTRIES_V10 = pkg_resources.resource_string(__name__, 'data/entries-v10')
ENTRIES_V10 = files('tests').joinpath('data/entries-v10').read_text()
"An entries file generated with svn 1.6.17 against the legacy Setuptools repo"


Expand Down Expand Up @@ -40,7 +44,7 @@ def _write_entries(self, entries):

@needs_svn
def test_version_10_format(self):
""""""
""" """
# keeping this set for 1.6 is a good check on the get_svn_revision
# to ensure I return using svnversion what would had been returned
version_str = svn_utils.SvnInfo.get_svn_version()
Expand All @@ -53,7 +57,7 @@ def test_version_10_format(self):
assert rev == '89000'

def test_version_10_format_legacy_parser(self):
""""""
""" """
path_variable = None
for env in os.environ:
if env.lower() == 'path':
Expand Down

0 comments on commit 55c798c

Please sign in to comment.