From 3798d83a70e264908924326bcf67c56256bdc5df Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Sat, 25 Aug 2018 03:36:00 +0000 Subject: [PATCH 1/2] Update deployment section of advanced docs Clarify that `--deploy` is meant for enforcement and intentionally failing a build. Mention `pipenv sync` in the same section to try to establish it more clearly as the most obvious and normal way of doing installation from ``Pipfile.lock`` as part of a reproducible build process. Explicitly recommend against `pipenv install --ignore-pipfile` and suggest that it may be deprecated. --- docs/advanced.rst | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/advanced.rst b/docs/advanced.rst index ceaf64d5..4fc6b445 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -102,9 +102,26 @@ Here's a more complex example:: Magic. Pure, unadulterated magic. +☤ Using pipenv for Deployments +------------------------------ -☤ Deploying System Dependencies -------------------------------- +You may want to use ``pipenv`` as part of a deployment process. + +You can enforce that your ``Pipfile.lock`` is up to date using the ``--deploy`` flag:: + + $ pipenv install --deploy + +This will fail a build if the ``Pipfile.lock`` is out–of–date, instead of generating a new one. + +Or you can install packages exactly as specified in ``Pipfile.lock`` using the sync command:: + + $ pipenv sync + +Note: ``pipenv install --ignore-pipfile`` is nearly equivalent to ``pipenv sync``, but you should use ``pipenv sync`` instead. +``--ignore-pipfile`` may be removed in a future version. + +Deploying System Dependencies +///////////////////////////// You can tell Pipenv to install a Pipfile's contents into its parent system with the ``--system`` flag:: @@ -112,13 +129,6 @@ You can tell Pipenv to install a Pipfile's contents into its parent system with This is useful for Docker containers, and deployment infrastructure (e.g. Heroku does this). -Also useful for deployment is the ``--deploy`` flag:: - - $ pipenv install --system --deploy - -This will fail a build if the ``Pipfile.lock`` is out–of–date, instead of generating a new one. - - ☤ Pipenv and Other Python Distributions --------------------------------------- From 7f602daf9898612e6889895295198a3ae09cd1ec Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Fri, 31 Aug 2018 00:16:09 -0400 Subject: [PATCH 2/2] Expand a bit on sync vs ignore-pipfile - expanded a bit on the distinction between `sync` and `ignore-pipfile` - fixed a merge conflict resolution I did that erased some changes in master --- docs/advanced.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/advanced.rst b/docs/advanced.rst index fc23cc1a..f3122724 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -113,12 +113,13 @@ You can enforce that your ``Pipfile.lock`` is up to date using the ``--deploy`` This will fail a build if the ``Pipfile.lock`` is out–of–date, instead of generating a new one. -Or you can install packages exactly as specified in ``Pipfile.lock`` using the sync command:: +Or you can install packages exactly as specified in ``Pipfile.lock`` using the ``sync`` command:: $ pipenv sync -Note: ``pipenv install --ignore-pipfile`` is nearly equivalent to ``pipenv sync``, but you should use ``pipenv sync`` instead. -``--ignore-pipfile`` may be removed in a future version. +.. note:: + + ``pipenv install --ignore-pipfile`` is nearly equivalent to ``pipenv sync``, but you ``pipenv sync`` will *never* attempt to re-lock your dependencies as it is considered an atomic operation. ``pipenv install`` by default does attempt to re-lock unless using the ``--deploy`` flag. Deploying System Dependencies ///////////////////////////// @@ -127,7 +128,7 @@ You can tell Pipenv to install a Pipfile's contents into its parent system with $ pipenv install --system -This is useful for Docker containers, and deployment infrastructure (e.g. Heroku does this). +This is useful for managing the system Python, and deployment infrastructure (e.g. Heroku does this). ☤ Pipenv and Other Python Distributions ---------------------------------------