From 60947a07eddec928cd23ca9e1c2d443b4a59d93f Mon Sep 17 00:00:00 2001 From: jxltom Date: Fri, 9 Nov 2018 09:50:01 +0800 Subject: [PATCH 1/5] Remove blank lines in pipenv graph --- pipenv/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index dabf065c..83b9a2a7 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2517,7 +2517,7 @@ def do_graph(bare=False, json=False, json_tree=False, reverse=False): click.echo(simplejson.dumps(data, indent=4)) sys.exit(0) else: - for line in c.out.split("\n"): + for line in c.out.strip().split("\n"): # Ignore bad packages as top level. if line.split("==")[0] in BAD_PACKAGES and not reverse: continue From fc2c2ef29ee982906cc8f3a402286ffbd1370c0d Mon Sep 17 00:00:00 2001 From: jxltom Date: Fri, 9 Nov 2018 09:51:20 +0800 Subject: [PATCH 2/5] Add traivial news for issue 3199 --- news/3199.trivial | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3199.trivial diff --git a/news/3199.trivial b/news/3199.trivial new file mode 100644 index 00000000..1fcca7de --- /dev/null +++ b/news/3199.trivial @@ -0,0 +1 @@ +Remove blank lines for pipenv graph From dbf21d5195e82e6d03816e92dd33b37c3c0577ca Mon Sep 17 00:00:00 2001 From: jxltom Date: Fri, 9 Nov 2018 09:56:04 +0800 Subject: [PATCH 3/5] Do not raise exception for pipenv graph when virtualenv does not exist --- pipenv/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pipenv/core.py b/pipenv/core.py index dabf065c..d3d05a0d 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2438,6 +2438,9 @@ def do_graph(bare=False, json=False, json_tree=False, reverse=False): err=True, ) sys.exit(1) + except RuntimeError: + pass + if reverse and json: click.echo( u"{0}: {1}".format( From 9d33d6323dc69199ed4ce536f14177ee963fac5e Mon Sep 17 00:00:00 2001 From: jxltom Date: Fri, 9 Nov 2018 10:00:29 +0800 Subject: [PATCH 4/5] Add bugfix news for issue 3201 --- news/3201.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3201.bugfix diff --git a/news/3201.bugfix b/news/3201.bugfix new file mode 100644 index 00000000..01dba4f6 --- /dev/null +++ b/news/3201.bugfix @@ -0,0 +1 @@ +Fix a bug where exception is raised when run pipenv graph in a project without created virtualenv From a067a084789ed9c0506bbbb6d5904459a3b1655c Mon Sep 17 00:00:00 2001 From: jxltom Date: Fri, 9 Nov 2018 11:35:11 +0800 Subject: [PATCH 5/5] Pass requirements para to only in get_requirements --- pipenv/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index dabf065c..c77e14a1 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -721,7 +721,7 @@ def do_install_dependencies( # Allow pip to resolve dependencies when in skip-lock mode. no_deps = not skip_lock failed_deps_list = [] - deps_list = list(lockfile.get_requirements(dev=dev, only=True)) + deps_list = list(lockfile.get_requirements(dev=dev, only=requirements)) if requirements: index_args = prepare_pip_source_args(project.sources) index_args = " ".join(index_args).replace(" -", "\n-")