From 9ec9ba687e2b9679d591d1a75ea3f2c3de59f5da Mon Sep 17 00:00:00 2001 From: Peanut Date: Wed, 24 Jan 2024 11:46:14 +0800 Subject: [PATCH] perf: Warnings that the correct version cannot be matched before the environment is finally created. (#2584) --- src/pdm/project/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pdm/project/core.py b/src/pdm/project/core.py index bc56c2b5cc..db5f3e044a 100644 --- a/src/pdm/project/core.py +++ b/src/pdm/project/core.py @@ -234,6 +234,10 @@ def note(message: str) -> None: return python if not self.root.joinpath("__pypackages__").exists(): + self.core.ui.warn( + f"Project requires a python version of {self.python_requires}, " + f"The virtualenv is being created for you as it cannot be matched to the right version." + ) note("python.use_venv is on, creating a virtualenv for this project...") venv_path = self._create_virtualenv() self.python = PythonInfo.from_path(get_venv_python(venv_path))