Strange dependency specifier behavior when using export
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- build-system, tooling
Direzione di ricerca
Inizia dalle dichiarazioni delle dipendenze in pyproject.toml e riproduci il problema usando poetry export --dev --format=requirements.txt, quindi testa pip install --constraint=requirements.txt moto in un ambiente virtuale pulito. Il lavoro è completato quando il marker cryptography esportato e gli hash non causano più l’errore di pip relativo a --require-hashes per le combinazioni di dipendenze descritte.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: macos 10.15.7
- Poetry version: 1.1.4
Issue
This is related to python-poetry/poetry-export-plugin#30 and comes from this comment: https://github.com/python-poetry/poetry/issues/3160#issuecomment-726236225
Now though, I have a clear example of what's happening in the requirements.txt file that is breaking the install.
Here is the relevant portion of a boilerplate pyproject.toml file from poetry new
[tool.poetry.dependencies]
python = "~3.8"
[tool.poetry.dev-dependencies]
moto = "1.3.14"
python-semantic-release = "^6.4"
# cryptography = "^3.2.1"
Here is the relevant output of poetry export --dev --format=requirements.txt
cryptography==3.2.1; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "linux" or sys_platform == "linux" and python_version >= "3.6" and python_full_version >= "3.5.0" \
--hash=sha256:6dc59630ecce8c1f558277ceb212c751d6730bd12c80ea96b4ac65637c4f55e7 \
...
If I create a new identical clean virtual environment (replicating a pipeline setup that uses nox or tox) and run pip install --constraint=requirements.txt moto, I will get something like this:
$ pip install --constraint=requirements.txt moto
...
ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
cryptography>=2.3.0 from https://files.pythonhosted.org/packages/c4/78/6c28c899181c395d8e07778110caff21248ba97774e567e7f7895951d92e/cryptography-3.2.1-cp35-abi3-macosx_10_10_x86_64.whl#sha256=bd717aa029217b8ef94a7d21632a3bb5a4e7218a4513d2521c2a2fd63011e98b (from moto==1.3.14->-c requirements.txt (line 387))
If I uncomment the cryptography dependency, the relevant line in the requirements.txt file will become:
cryptography==3.2.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0") \
--hash=sha256:6dc59630ecce8c1f558277ceb212c751d6730bd12c80ea96b4ac65637c4f55e7 \
...
which is a dependency pattern that looks much nicer and more sane. And the pip install ends up working fine.
Alternatively, if I remove the dependency on python-semantic-release and leave cryptography commented out, this also works. This problem appears to come from some combination a) the dependency solve between these two packages that use cryptography directly or through another dependency, b) the writing of the lock file, and c) the exporting of the lock file to requirements.
- Lingua principale
- Python
- Stelle
- 336
- Fork
- 59
- Merge medio
- 10m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-poetry/poetry-plugin-export
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Does not installAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
python-poetry/poetry-plugin-export#341 · 5 commenti · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
python-poetry/poetry-plugin-export#340 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 52/100
Tutte le issue di python-poetry/poetry-plugin-export
Issue simili
-
New InternshipApertanew_internship
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
get_graph warns that the oneway column is missing when no way has a oneway tagForse già presa @HTenkanen l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cython/cython#8110 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
fix: security 🔐 style: article/section 📝 system: data-mgmt 🗃️ system: security 🔐 system: software 💻
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
uabrc/uabrc.github.io#1267 ·
-
Link Checker ReportApertaBot Type: Bug Type: Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno