Skip to content

Commit e2d8d70

Browse files
committed
Fixup graph to be generated for selected interpreter.
1 parent b337439 commit e2d8d70

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pex/tools/commands/graph.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ class Graph(OutputMixin, Command):
3030

3131
@staticmethod
3232
def _create_dependency_graph(pex):
33-
graph = DiGraph(pex.path(), fontsize="14")
34-
marker_environment = PythonInterpreter.get().identity.env_markers.copy()
33+
# type: (PEX) -> DiGraph
34+
graph = DiGraph(
35+
pex.path(),
36+
fontsize="14",
37+
labelloc="t",
38+
label="Dependency graph of {} for interpreter {} ({})".format(
39+
pex.path(), pex.interpreter.binary, pex.interpreter.identity.requirement
40+
),
41+
)
42+
marker_environment = pex.interpreter.identity.env_markers.copy()
3543
marker_environment["extra"] = []
3644
present_dists = frozenset(dist.project_name for dist in pex.activate())
3745
for dist in pex.activate():
@@ -41,6 +49,7 @@ def _create_dependency_graph(pex):
4149
URL="https://pypi.org/project/{name}/{version}".format(
4250
name=dist.project_name, version=dist.version
4351
),
52+
target="_blank",
4453
)
4554
for req in requires_dists(dist):
4655
if (
@@ -54,6 +63,7 @@ def _create_dependency_graph(pex):
5463
style="filled",
5564
tooltip="inactive requirement",
5665
URL="https://pypi.org/project/{name}".format(name=req.project_name),
66+
target="_blank",
5767
)
5868
graph.add_edge(
5969
start=dist.project_name,

0 commit comments

Comments
 (0)