From fee04e5ece3493139458ac4939d3352807769afe Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Thu, 4 Nov 2021 21:21:50 +0800 Subject: [PATCH] Re-install `pip` inside the venv Close #685 --- README.md | 4 +++- README_zh.md | 6 ++++-- install-pdm.py | 4 ++++ news/685.bugfix.md | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 news/685.bugfix.md diff --git a/README.md b/README.md index 50f36323..24cb6147 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ is [pyflow], but it is written with Rust and thus can't get much help from the b PDM requires python version 3.7 or higher. +### Via Install Script + Like Pip, PDM provides an installation script that will install PDM into an isolated environment. **For Linux/Mac** @@ -108,7 +110,7 @@ optional arguments: You can either pass the options after the script or set the env var value. -## Alternative Installation Methods +### Alternative Installation Methods If you are on MacOS and using `homebrew`, install it by: diff --git a/README_zh.md b/README_zh.md index 02f0ba4f..9a49e865 100644 --- a/README_zh.md +++ b/README_zh.md @@ -68,6 +68,8 @@ foo PDM 需要 Python 3.7 或更高版本。 +### 通过安装脚本 + 像 pip 一样,PDM 也提供了一键安装脚本,用来将 PDM 安装在一个隔离的环境中。 **Linux/Mac 安装命令** @@ -104,7 +106,7 @@ optional arguments: 你既可以通过直接增加选项,也可以通过设置对应的环境变量来达到这一效果。 -## 其他安装方法 +### 其他安装方法 如果你使用的是 MacOS 并且安装了 `homebrew`: @@ -112,7 +114,7 @@ optional arguments: $ brew install pdm ``` -如果你在Windows上使用 [Scoop](https://scoop.sh/), 运行以下命令安装: +如果你在 Windows 上使用 [Scoop](https://scoop.sh/), 运行以下命令安装: ``` PS> scoop bucket add frostming https://github.com/frostming/scoop-frostming.git diff --git a/install-pdm.py b/install-pdm.py index 436bf1e1..e26e1a4b 100644 --- a/install-pdm.py +++ b/install-pdm.py @@ -290,6 +290,10 @@ class Installer: else: venv_python = venv_path / "bin/python" + # Re-install the venv pip to ensure it's not DEBUNDLED + # See issue/685 + _call_subprocess([str(venv_python), "-m", "pip", "install", "-IU", "pip"]) + if self.version: if self.version.upper() == "HEAD": req = f"git+{REPO}.git@main#egg=pdm" diff --git a/news/685.bugfix.md b/news/685.bugfix.md new file mode 100644 index 00000000..5f5b4367 --- /dev/null +++ b/news/685.bugfix.md @@ -0,0 +1 @@ +Fix the install script to ensure `pip` is not DEBUNDLED. -- GitLab