Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
46bdcf7d
Commit
46bdcf7d
authored
Jun 08, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Packaging: always use repr to display project names.
This helps debugging in case of trailing blanks and such things.
parent
ea888e03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Lib/packaging/depgraph.py
Lib/packaging/depgraph.py
+8
-7
No files found.
Lib/packaging/depgraph.py
View file @
46bdcf7d
...
...
@@ -72,7 +72,7 @@ class DependencyGraph:
self
.
missing
[
distribution
].
append
(
requirement
)
def
_repr_dist
(
self
,
dist
):
return
'%
s
%s'
%
(
dist
.
name
,
dist
.
metadata
[
'Version'
])
return
'%
r
%s'
%
(
dist
.
name
,
dist
.
metadata
[
'Version'
])
def
repr_node
(
self
,
dist
,
level
=
1
):
"""Prints only a subgraph"""
...
...
@@ -154,8 +154,8 @@ def generate_graph(dists):
if
len
(
comps
)
==
2
:
version
=
comps
[
1
]
if
len
(
version
)
<
3
or
version
[
0
]
!=
'('
or
version
[
-
1
]
!=
')'
:
raise
PackagingError
(
'
Distribution %s has ill formed'
\
'provides field: %
s
'
%
(
dist
.
name
,
p
))
raise
PackagingError
(
'
distribution %r has ill-formed'
'provides field: %
r
'
%
(
dist
.
name
,
p
))
version
=
version
[
1
:
-
1
]
# trim off parenthesis
if
not
name
in
provided
:
provided
[
name
]
=
[]
...
...
@@ -204,8 +204,9 @@ def dependent_dists(dists, dist):
:param dists: a list of distributions
:param dist: a distribution, member of *dists* for which we are interested
"""
if
not
dist
in
dists
:
raise
ValueError
(
'The given distribution is not a member of the list'
)
if
dist
not
in
dists
:
raise
ValueError
(
'given distribution %r is not a member of the list'
%
dist
.
name
)
graph
=
generate_graph
(
dists
)
dep
=
[
dist
]
# dependent distributions
...
...
@@ -243,7 +244,7 @@ def main():
for
dist
,
reqs
in
graph
.
missing
.
items
():
if
len
(
reqs
)
>
0
:
print
(
"Warning: Missing dependencies for %
s
:"
%
dist
.
name
,
print
(
"Warning: Missing dependencies for %
r
:"
%
dist
.
name
,
", "
.
join
(
reqs
))
# XXX replace with argparse
if
len
(
sys
.
argv
)
==
1
:
...
...
@@ -261,7 +262,7 @@ def main():
tempout
.
seek
(
0
)
tempout
=
tempout
.
read
()
print
(
tempout
)
print
(
'Dot file written at
"%s"
'
%
filename
)
print
(
'Dot file written at
%r
'
%
filename
)
sys
.
exit
(
0
)
else
:
print
(
'Supported option: -d [filename]'
)
...
...
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