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
c87de03d
Commit
c87de03d
authored
Apr 11, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude children of excluded parents when doing package discovery. Fixes #184.
parent
b118b5f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
CHANGES.txt
CHANGES.txt
+7
-0
setuptools/__init__.py
setuptools/__init__.py
+17
-0
No files found.
CHANGES.txt
View file @
c87de03d
...
...
@@ -2,6 +2,13 @@
CHANGES
=======
-----
3.4.4
-----
* Issue #184: Correct failure where find_package over-matched packages
when directory traversal isn't short-circuited.
-----
3.4.3
-----
...
...
setuptools/__init__.py
View file @
c87de03d
...
...
@@ -50,12 +50,29 @@ class PackageFinder(object):
explicitly excluded packages are removed from it.
"""
out
=
cls
.
_find_packages_iter
(
convert_path
(
where
))
out
=
cls
.
require_parents
(
out
)
includes
=
cls
.
_build_filter
(
*
include
)
excludes
=
cls
.
_build_filter
(
'ez_setup'
,
'*__pycache__'
,
*
exclude
)
out
=
filter
(
includes
,
out
)
out
=
filterfalse
(
excludes
,
out
)
return
list
(
out
)
@
staticmethod
def
require_parents
(
packages
):
"""
Exclude any apparent package that apparently doesn't include its
parent.
For example, exclude 'foo.bar' if 'foo' is not present.
"""
found
=
[]
for
pkg
in
packages
:
base
,
sep
,
child
=
pkg
.
rpartition
(
'.'
)
if
base
and
base
not
in
found
:
continue
found
.
append
(
pkg
)
yield
pkg
@
staticmethod
def
_all_dirs
(
base_path
):
"""
...
...
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