opencv / opencv/opencv-python

[Suggestion] Metapackage as solution to current issues with opencv as dependency

Aperta
#987 3 commenti 8 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
5.4k
Fork
1k
Merge medio
22h 17m
PR unite (30g)
3

Descrizione

Expected behaviour

Depending on opencv-python has always been an issue, depending on whether libraries used opencv-python, opencv-python-headless, opencv-contrib-python or opencv-contrib-python-headless. I do know that opencv isn't designed as a plugin system, which is why it had to be done that way. But as a result, usually special workarounds like detecting inside setup.py what version of opencv-python is installed, or needing the user to manually uninstall then reinstall the version of opencv they want, is needed. This makes dependency management when depending on opencv complicated.

My suggestion is what if there could be an opencv-meta package instead, where which version is pulled in depends on extra flags. The mapping could be like:

  • opencv-meta -> opencv-python
  • opencv-meta[headless] -> opencv-python-headless
  • opencv-meta[contrib] -> opencv-contrib-python
  • opencv-meta[contrib,headless] -> opencv-contrib-python-headless

This can be on top of the existing four packages to avoid breaking existing libraries. Given sufficient adoption of depending on opencv-meta rather than the different versions of opencv, it should hopefully resolve the dependency issues one day.

That said, I might not be thinking deep enough and there is still something seriously wrong about the above approach.

Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dagli script di build del repository e dai metadati dei quattro pacchetti Python OpenCV esistenti. Confronta come potrebbero essere rappresentate le varianti delle dipendenze e gli extras, quindi esamina la discussione dell’issue per individuare vincoli o obiezioni. Il lavoro sarà completo quando sarà disponibile un approccio approvato da un Maintainer per introdurre il metapackage proposto senza compromettere i pacchetti esistenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
opencv, python
Ambito
build-system
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.