From 426b0f15f5227b0f72c18d2da83fb99bcdf77088 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 25 Sep 2017 16:50:12 -0400 Subject: [PATCH] [pipenv] pre=True Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 9 +++++++++ pipenv/project.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/pipenv/cli.py b/pipenv/cli.py index e20d4404..fa2ca872 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1645,6 +1645,10 @@ def install( # Ensure that virtualenv is available. ensure_project(three=three, python=python, system=system, warn=True) + # Load the --pre settings from the Pipfile. + if not pre: + pre = project.settings.get('pre') + if requirements: click.echo(crayons.normal(u'Requirements file provided! Importing into Pipfile…', bold=True), err=True) import_requirements(r=requirements, dev=dev) @@ -1863,6 +1867,11 @@ def lock(three=None, python=False, verbose=False, requirements=False, clear=Fals # Ensure that virtualenv is available. ensure_project(three=three, python=python) + # Load the --pre settings from the Pipfile. + if not pre: + pre = project.settings.get('pre') + + if requirements: do_init(dev=True, requirements=requirements) diff --git a/pipenv/project.py b/pipenv/project.py index fd2c39ad..757b1fbc 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -239,6 +239,11 @@ class Project(object): return pfile + @property + def settings(self): + """A dictionary of the settings added to the Pipfile.""" + return self.parsed_pipfile.get('pipenv', {}) + @property def _lockfile(self): """Pipfile.lock divided by PyPI and external dependencies."""