From 2ffe6b551c93deab0947948b2099a8551fe4cf71 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 5 Mar 2024 11:21:44 +0000 Subject: [PATCH] Declare a build dependency on `pip` Currently installing `fasttext` with `uv` fails, as `uv` does not, by default, include `pip` in new virtual environments: ```sh % uv venv new-venv Using Python 3.12.2 interpreter at: /Users/alexw/.pyenv/versions/3.12.2/bin/python3 Creating virtualenv at: new-venv Activate with: source new-venv/bin/activate % source new-venv/bin/activate (new-venv) % uv pip install fasttext error: Failed to download and build: fasttext==0.9.2 Caused by: Failed to build: fasttext==0.9.2 Caused by: Build backend failed to determine extra requires with `build_wheel()`: --- stdout: --- stderr: /Users/alexw/Library/Caches/uv/.tmp2ZDKtZ/.venv/bin/python: No module named pip Traceback (most recent call last): File "", line 38, in __init__ ModuleNotFoundError: No module named 'pybind11' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 14, in File "/Users/alexw/Library/Caches/uv/.tmp2ZDKtZ/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/alexw/Library/Caches/uv/.tmp2ZDKtZ/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires self.run_setup() File "/Users/alexw/Library/Caches/uv/.tmp2ZDKtZ/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup super().run_setup(setup_script=setup_script) File "/Users/alexw/Library/Caches/uv/.tmp2ZDKtZ/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 72, in File "", line 41, in __init__ RuntimeError: pybind11 install failed. --- ``` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c9cc5e3b9..ca6e25449 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "pybind11"] +requires = ["pip", "setuptools", "wheel", "pybind11"]