[BUG]: `tests/requirements.txt` not working on ARM-based MacOS
Les mainteneurs répondent en général sous 4 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 52/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- macos, python
- Domaine
- build-system, testing
Piste de recherche
Commencez par tests/requirements.txt et reproduisez la commande d’installation de virtualenv documentée sur un système MacOS basé sur ARM avec Python 3.9. Vérifiez les contraintes de SciPy et les marqueurs de plateforme, puis vérifiez que les dépendances s’installent correctement sur ARM MacOS sans modifier les sélections prévues pour les autres plateformes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
What version (or hash if on master) of pybind11 are you using?
19a6b9f4efb569129c878b7f8db09132248fbaa1
Problem description
I tried following the installation instructions as written here on an ARM-based MacOS, and I didn't get very far since tests/requirements.txt doesn't seem to work (the below is in a venv):
$ python -V
Python 3.9.19
$ python -m pip -V
pip 24.0 from /pybind11/venv/lib/python3.9/site-packages/pip (python 3.9)
$ python -m pip install -r tests/requirements.txt --no-cache-dir
Ignoring build: markers 'python_version == "3.6"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_python_implementation == "PyPy"' don't match your environment
Ignoring numpy: markers 'python_version == "3.8" and platform_python_implementation == "PyPy"' don't match your environment
Ignoring numpy: markers 'python_version == "3.9" and platform_python_implementation == "PyPy"' don't match your environment
Ignoring numpy: markers 'platform_python_implementation != "PyPy" and python_version == "3.6"' don't match your environment
Ignoring numpy: markers 'platform_python_implementation != "PyPy" and python_version == "3.10"' don't match your environment
Ignoring numpy: markers 'platform_python_implementation != "PyPy" and python_version >= "3.11" and python_version < "3.13"' don't match your environment
Ignoring scipy: markers 'platform_python_implementation != "PyPy" and python_version == "3.10"' don't match your environment
Ignoring scipy: markers 'platform_python_implementation != "PyPy" and python_version >= "3.11" and python_version < "3.13"' don't match your environment
Collecting build~=1.0 (from -r tests/requirements.txt (line 3))
Downloading build-1.2.1-py3-none-any.whl.metadata (4.3 kB)
Collecting numpy~=1.21.5 (from -r tests/requirements.txt (line 8))
Downloading numpy-1.21.6-cp39-cp39-macosx_11_0_arm64.whl.metadata (2.1 kB)
Collecting pytest~=7.0 (from -r tests/requirements.txt (line 11))
Downloading pytest-7.4.4-py3-none-any.whl.metadata (7.9 kB)
Collecting pytest-timeout (from -r tests/requirements.txt (line 12))
Downloading pytest_timeout-2.3.1-py3-none-any.whl.metadata (20 kB)
ERROR: Ignored the following yanked versions: 1.11.0
ERROR: Could not find a version that satisfies the requirement scipy~=1.5.4 (from versions: 1.7.3, 1.8.0rc1, 1.8.0rc2, 1.8.0rc3, 1.8.0rc4, 1.8.0, 1.8.1, 1.9.0rc1, 1.9.0rc2, 1.9.0rc3, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0rc1, 1.10.0rc2, 1.10.0, 1.10.1, 1.11.0rc1, 1.11.0rc2, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.13.0rc1, 1.13.0)
ERROR: No matching distribution found for scipy~=1.5.4
The problem is caused by the --only-binary=:all: header, as scipy 1.5.4 is not available as a wheel for ARM-based MacOS. Note that installation of scipy from source also fails, but that's expected since the ARM-based Macs only came out around the same time as that scipy version.
As a workaround, the following diff seems to work (the specific version of scipy was found by looking at the changelog):
diff --git a/tests/requirements.txt b/tests/requirements.txt
index e056c6fa..0c80edc9 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -10,6 +10,7 @@ numpy~=1.22.2; platform_python_implementation!="PyPy" and python_version=="3.10"
numpy~=1.26.0; platform_python_implementation!="PyPy" and python_version>="3.11" and python_version<"3.13"
pytest~=7.0
pytest-timeout
-scipy~=1.5.4; platform_python_implementation!="PyPy" and python_version<"3.10"
+scipy~=1.7.3; platform_python_implementation!="PyPy" and python_version<"3.10" and platform_system=="Darwin" and platform_machine=="arm64"
+scipy~=1.5.4; platform_python_implementation!="PyPy" and python_version<"3.10" and platform_machine!="arm64"
scipy~=1.8.0; platform_python_implementation!="PyPy" and python_version=="3.10"
scipy~=1.11.1; platform_python_implementation!="PyPy" and python_version>="3.11" and python_version<"3.13"
Reproducible example code
python3.9 -m venv venv && source venv/bin/activate && python -m pip install -r tests/requirements.txt --no-cache-dir
Is this a regression? Put the last known working version here if it is.
Not a regression
- Langage dominant
- C++
- Étoiles
- 18k
- Forks
- 2.3k
- Merge moyen
- 5 j 7 h
- PR mergées (30 j)
- 53
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pybind/pybind11
-
triage
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 4 jours
-
triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
pybind/pybind11#5604 · 1 commentaire ·
Les mainteneurs répondent en général sous 4 jours
-
triage
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 4 jours
-
docs
Difficulté 2/5 1-3 heures Accessibilité débutants 60/100
pybind/pybind11#747 · 2 commentaires ·
Les mainteneurs répondent en général sous 4 jours
-
array_t::at() returns a misaligned reference when the stride is not a multiple of alignof(T)Peut-être pris @henryiii l’a pris aujourd’hui. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 4 jours
Toutes les issues de pybind/pybind11
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
jesdga95/basalt#747 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
tenstorrent/tt-umd#4084 ·
Les mainteneurs répondent en général sous 5 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
ToffelsKater/X4_VR#34 ·