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
17c19bd6
Commit
17c19bd6
authored
Mar 22, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extracted directory detection and presence of '.' in name.
parent
45457777
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
setuptools/__init__.py
setuptools/__init__.py
+15
-7
No files found.
setuptools/__init__.py
View file @
17c19bd6
...
@@ -50,15 +50,13 @@ def find_packages(where='.', exclude=(), include=('*',)):
...
@@ -50,15 +50,13 @@ def find_packages(where='.', exclude=(), include=('*',)):
stack
=
[(
convert_path
(
where
),
''
)]
stack
=
[(
convert_path
(
where
),
''
)]
while
stack
:
while
stack
:
where
,
prefix
=
stack
.
pop
(
0
)
where
,
prefix
=
stack
.
pop
(
0
)
for
name
in
os
.
listdir
(
where
):
dirs
=
_dirs
(
where
)
suitable
=
filterfalse
(
lambda
n
:
'.'
in
n
,
dirs
)
for
name
in
suitable
:
fn
=
os
.
path
.
join
(
where
,
name
)
fn
=
os
.
path
.
join
(
where
,
name
)
looks_like_package
=
(
looks_like_package
=
(
'.'
not
in
name
os
.
path
.
isfile
(
os
.
path
.
join
(
fn
,
'__init__.py'
))
and
os
.
path
.
isdir
(
fn
)
or
sys
.
version_info
[:
2
]
>=
(
3
,
3
)
# PEP 420
and
(
os
.
path
.
isfile
(
os
.
path
.
join
(
fn
,
'__init__.py'
))
or
sys
.
version_info
[:
2
]
>=
(
3
,
3
)
# PEP 420
)
)
)
if
looks_like_package
:
if
looks_like_package
:
pkg_name
=
prefix
+
name
pkg_name
=
prefix
+
name
...
@@ -70,6 +68,16 @@ def find_packages(where='.', exclude=(), include=('*',)):
...
@@ -70,6 +68,16 @@ def find_packages(where='.', exclude=(), include=('*',)):
out
=
filterfalse
(
excludes
,
out
)
out
=
filterfalse
(
excludes
,
out
)
return
list
(
out
)
return
list
(
out
)
def
_dirs
(
target
):
"""
Return all directories in target
"""
return
(
fn
for
fn
in
os
.
listdir
(
target
)
if
os
.
path
.
isdir
(
os
.
path
.
join
(
target
,
fn
))
)
def
_build_filter
(
*
patterns
):
def
_build_filter
(
*
patterns
):
"""
"""
Given a list of patterns, return a callable that will be true only if
Given a list of patterns, return a callable that will be true only if
...
...
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