From e7c93b0fc8bcb89efae203b3432e49a00be522d4 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 1 Feb 2022 14:51:13 +0100 Subject: [PATCH] update pipenv to 2022.1.8 pipenv 2018 doesn't actually clear its cache when asked to 2021.5.29 is the last to support 2.7, 3.5 --- repo2docker/buildpacks/pipfile/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/repo2docker/buildpacks/pipfile/__init__.py b/repo2docker/buildpacks/pipfile/__init__.py index 20214099..e928d01e 100644 --- a/repo2docker/buildpacks/pipfile/__init__.py +++ b/repo2docker/buildpacks/pipfile/__init__.py @@ -11,6 +11,7 @@ import re import toml +from ...semver import parse_version as V from ..conda import CondaBuildPack VERSION_PAT = re.compile(r"\d+(\.\d+)*") @@ -87,10 +88,15 @@ class PipfileBuildPack(CondaBuildPack): """scripts to run prior to staging the repo contents""" scripts = super().get_preassemble_scripts() # install pipenv to install dependencies within Pipfile.lock or Pipfile + if V(self.python_version) < V("3.6"): + # last pipenv version to support 2.7, 3.5 + pipenv_version = "2021.5.29" + else: + pipenv_version = "2022.1.8" scripts.append( ( "${NB_USER}", - "${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir pipenv==2018.11.26", + f"${{KERNEL_PYTHON_PREFIX}}/bin/pip install --no-cache-dir pipenv=={pipenv_version}", ) ) return scripts