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
bd621219
Commit
bd621219
authored
Sep 26, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract method for calculating namespace packages for single_version_externally_managed
parent
e8914480
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
setuptools/command/install_lib.py
setuptools/command/install_lib.py
+23
-11
No files found.
setuptools/command/install_lib.py
View file @
bd621219
...
...
@@ -17,19 +17,31 @@ class install_lib(orig.install_lib):
excluded for single_version_externally_managed installations.
"""
exclude
=
set
()
nsp
=
self
.
distribution
.
namespace_packages
svem
=
(
nsp
and
self
.
get_finalized_command
(
'install'
)
.
single_version_externally_managed
)
if
svem
:
for
pkg
in
nsp
:
parts
=
pkg
.
split
(
'.'
)
while
parts
:
pkgdir
=
os
.
path
.
join
(
self
.
install_dir
,
*
parts
)
for
f
in
self
.
_gen_exclude_names
():
exclude
.
add
(
os
.
path
.
join
(
pkgdir
,
f
))
parts
.
pop
()
for
pkg
in
self
.
_get_SVEM_NSPs
():
parts
=
pkg
.
split
(
'.'
)
while
parts
:
pkgdir
=
os
.
path
.
join
(
self
.
install_dir
,
*
parts
)
for
f
in
self
.
_gen_exclude_names
():
exclude
.
add
(
os
.
path
.
join
(
pkgdir
,
f
))
parts
.
pop
()
return
exclude
def
_get_SVEM_NSPs
(
self
):
"""
Get namespace packages (list) but only for
single_version_externally_managed installations and empty otherwise.
"""
# TODO: is it necessary to short-circuit here? i.e. what's the cost
# if get_finalized_command is called even when namespace_packages is
# False?
if
not
self
.
distribution
.
namespace_packages
:
return
[]
install_cmd
=
self
.
get_finalized_command
(
'install'
)
svem
=
install_cmd
.
single_version_externally_managed
return
self
.
distribution
.
namespace_packages
if
svem
else
[]
@
staticmethod
def
_gen_exclude_names
():
"""
...
...
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