Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
5638e478
Commit
5638e478
authored
May 10, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To assess the directoriness of an entry, include the path of that entry.
parent
7b0a818f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
pkg_resources/__init__.py
pkg_resources/__init__.py
+4
-1
pkg_resources/tests/test_pkg_resources.py
pkg_resources/tests/test_pkg_resources.py
+1
-1
No files found.
pkg_resources/__init__.py
View file @
5638e478
...
@@ -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
...
...
pkg_resources/tests/test_pkg_resources.py
View file @
5638e478
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment