From c071f6150505053ba99632b911f18eda1cc92fd0 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Tue, 26 Jun 2018 21:32:00 -0400 Subject: [PATCH 1/4] Handle empty pipfile sections Signed-off-by: Dan Ryan --- pipenv/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/project.py b/pipenv/project.py index 0a9e04be0e..db515acf8e 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -624,7 +624,7 @@ def write_toml(self, data, path=None): formatted_data = contoml.dumps(data).rstrip() except Exception: for section in ('packages', 'dev-packages'): - for package in data[section]: + for package in data.get(section, {}): # Convert things to inline tables — fancy :) if hasattr(data[section][package], 'keys'): _data = data[section][package] From 88ff271a8db42b980161626a00be3565f55b5d35 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Tue, 26 Jun 2018 22:35:10 -0400 Subject: [PATCH 2/4] Fix tests for python 37 Signed-off-by: Dan Ryan --- tests/integration/test_install_markers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/test_install_markers.py b/tests/integration/test_install_markers.py index 0b88549399..ca6b70fe99 100644 --- a/tests/integration/test_install_markers.py +++ b/tests/integration/test_install_markers.py @@ -11,6 +11,7 @@ py3_only = pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") +skip_py37 = pytest.mark.skipif(sys.version_info >= (3, 7), reason="Skip for python 3.7") @pytest.mark.markers @@ -127,6 +128,7 @@ def test_global_overrides_environment_markers(PipenvInstance, pypi): @pytest.mark.complex @flaky @py3_only +@skip_py37 def test_resolver_unique_markers(PipenvInstance, pypi): """vcrpy has a dependency on `yarl` which comes with a marker of 'python version in "3.4, 3.5, 3.6" - this marker duplicates itself: From a4951d1595e5da4d661956223b45218f22826ad3 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Wed, 27 Jun 2018 00:06:01 -0400 Subject: [PATCH 3/4] Fix uninstall for `--all-dev` Signed-off-by: Dan Ryan --- pipenv/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index 4346f48727..7b30af909a 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2127,8 +2127,7 @@ def do_uninstall( bold=True, ) ) - package_names = project.parsed_pipfile['dev-packages'] - package_names = package_names.keys() + package_names = project.dev_packages.keys() if package_name is False and not all_dev: click.echo(crayons.red('No package provided!'), err=True) sys.exit(1) From b7d8cf49183bcba1b8021751122d7147d15a22ee Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Wed, 27 Jun 2018 00:57:29 -0400 Subject: [PATCH 4/4] Update vendored prettytoml Signed-off-by: Dan Ryan --- pipenv/patched/prettytoml/elements/abstracttable.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pipenv/patched/prettytoml/elements/abstracttable.py b/pipenv/patched/prettytoml/elements/abstracttable.py index 48663aed3f..6a2c174aec 100644 --- a/pipenv/patched/prettytoml/elements/abstracttable.py +++ b/pipenv/patched/prettytoml/elements/abstracttable.py @@ -24,7 +24,10 @@ def _enumerate_items(self): """ non_metadata = self._enumerate_non_metadata_sub_elements() while True: - yield next(non_metadata), next(non_metadata) + try: + yield next(non_metadata), next(non_metadata) + except StopIteration: + return def items(self): for (key_i, key), (value_i, value) in self._enumerate_items():