Commit 5638e478 authored by Jason R. Coombs's avatar Jason R. Coombs

To assess the directoriness of an entry, include the path of that entry.

parent 7b0a818f
...@@ -2072,7 +2072,10 @@ def dist_factory(path_item, entry, only): ...@@ -2072,7 +2072,10 @@ def dist_factory(path_item, entry, only):
"""Return a dist_factory for the given entry.""" """Return a dist_factory for the given entry."""
lower = entry.lower() lower = entry.lower()
is_egg_info = lower.endswith('.egg-info') is_egg_info = lower.endswith('.egg-info')
is_dist_info = lower.endswith('.dist-info') and not os.path.isfile(entry) is_dist_info = (
lower.endswith('.dist-info') and
os.path.isdir(os.path.join(path_item, entry))
)
is_meta = is_egg_info or is_dist_info is_meta = is_egg_info or is_dist_info
return ( return (
distributions_from_metadata distributions_from_metadata
......
...@@ -335,7 +335,7 @@ def test_dist_info_is_not_dir(tmp_path, only): ...@@ -335,7 +335,7 @@ def test_dist_info_is_not_dir(tmp_path, only):
"""Test path containing a file with dist-info extension.""" """Test path containing a file with dist-info extension."""
dist_info = tmp_path / 'foobar.dist-info' dist_info = tmp_path / 'foobar.dist-info'
dist_info.touch() dist_info.touch()
assert not pkg_resources.dist_factory(None, str(dist_info), only) assert not pkg_resources.dist_factory(str(tmp_path), str(dist_info), only)
class TestDeepVersionLookupDistutils: class TestDeepVersionLookupDistutils:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment