Skip to content

Commit

Permalink
Import dependencies naturally and ensure they're available by appendi…
Browse files Browse the repository at this point in the history
…ng the vendor dir to sys.path.
  • Loading branch information
jaraco committed Jul 3, 2024
1 parent 9234fc3 commit d03cd0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@

import _imp

sys.path.append(os.path.dirname(__file__) + '/_vendor')

# capture these to bypass sandboxing
from os import utime
from os import open as os_open
Expand All @@ -87,16 +89,16 @@
# no write support, probably under GAE
WRITE_SUPPORT = False

from pkg_resources.extern.jaraco.text import (
from jaraco.text import (
yield_lines,
drop_comment,
join_continuation,
)
from pkg_resources.extern.packaging import markers as _packaging_markers
from pkg_resources.extern.packaging import requirements as _packaging_requirements
from pkg_resources.extern.packaging import utils as _packaging_utils
from pkg_resources.extern.packaging import version as _packaging_version
from pkg_resources.extern.platformdirs import user_cache_dir as _user_cache_dir
from packaging import markers as _packaging_markers
from packaging import requirements as _packaging_requirements
from packaging import utils as _packaging_utils
from packaging import version as _packaging_version
from platformdirs import user_cache_dir as _user_cache_dir

if TYPE_CHECKING:
from _typeshed import BytesPath, StrPath, StrOrBytesPath
Expand Down
2 changes: 1 addition & 1 deletion pkg_resources/tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import itertools

import pytest
from pkg_resources.extern.packaging.specifiers import SpecifierSet
from packaging.specifiers import SpecifierSet

import pkg_resources
from pkg_resources import (
Expand Down

0 comments on commit d03cd0e

Please sign in to comment.