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
45457777
Commit
45457777
authored
Mar 21, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract out filtering by filename
parent
8a4809f7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
setuptools/__init__.py
setuptools/__init__.py
+13
-7
No files found.
setuptools/__init__.py
View file @
45457777
...
@@ -12,6 +12,7 @@ import setuptools.version
...
@@ -12,6 +12,7 @@ import setuptools.version
from
setuptools.extension
import
Extension
from
setuptools.extension
import
Extension
from
setuptools.dist
import
Distribution
,
Feature
,
_get_unpatched
from
setuptools.dist
import
Distribution
,
Feature
,
_get_unpatched
from
setuptools.depends
import
Require
from
setuptools.depends
import
Require
from
setuptools.compat
import
filterfalse
__all__
=
[
__all__
=
[
'setup'
,
'Distribution'
,
'Feature'
,
'Command'
,
'Extension'
,
'Require'
,
'setup'
,
'Distribution'
,
'Feature'
,
'Command'
,
'Extension'
,
'Require'
,
...
@@ -47,8 +48,6 @@ def find_packages(where='.', exclude=(), include=('*',)):
...
@@ -47,8 +48,6 @@ def find_packages(where='.', exclude=(), include=('*',)):
"""
"""
out
=
[]
out
=
[]
stack
=
[(
convert_path
(
where
),
''
)]
stack
=
[(
convert_path
(
where
),
''
)]
include
=
list
(
include
)
exclude
=
list
(
exclude
)
+
[
'ez_setup'
,
'*__pycache__'
]
while
stack
:
while
stack
:
where
,
prefix
=
stack
.
pop
(
0
)
where
,
prefix
=
stack
.
pop
(
0
)
for
name
in
os
.
listdir
(
where
):
for
name
in
os
.
listdir
(
where
):
...
@@ -65,11 +64,18 @@ def find_packages(where='.', exclude=(), include=('*',)):
...
@@ -65,11 +64,18 @@ def find_packages(where='.', exclude=(), include=('*',)):
pkg_name
=
prefix
+
name
pkg_name
=
prefix
+
name
out
.
append
(
pkg_name
)
out
.
append
(
pkg_name
)
stack
.
append
((
fn
,
pkg_name
+
'.'
))
stack
.
append
((
fn
,
pkg_name
+
'.'
))
for
pat
in
include
:
includes
=
_build_filter
(
*
include
)
out
=
[
item
for
item
in
out
if
fnmatchcase
(
item
,
pat
)]
excludes
=
_build_filter
(
'ez_setup'
,
'*__pycache__'
,
*
exclude
)
for
pat
in
exclude
:
out
=
filter
(
includes
,
out
)
out
=
[
item
for
item
in
out
if
not
fnmatchcase
(
item
,
pat
)]
out
=
filterfalse
(
excludes
,
out
)
return
out
return
list
(
out
)
def
_build_filter
(
*
patterns
):
"""
Given a list of patterns, return a callable that will be true only if
the input matches one of the patterns.
"""
return
lambda
name
:
any
(
fnmatchcase
(
name
,
pat
=
pat
)
for
pat
in
patterns
)
setup
=
distutils
.
core
.
setup
setup
=
distutils
.
core
.
setup
...
...
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