Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pip with ensure => latest can spuriously skip the install

Aperta
#350 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
devops

Direzione di ricerca

The issue does not name a file or test; start by locating the pip resource's ensure => latest check and reproduce the shown pip search ... | grep ... command. Done means related package results no longer make an unrelated package appear installed, with a regression test for the Google package example.

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

Descrizione

The pip resource checks whether the latest version is installed using essentially pip search pkg_name | grep -i INSTALLED.*latest. This can give false positives if you have one or more other related packages already installed, because pip search matches package names and descriptions. It doesn't seem to have an option for matching the package name exactly.

I observed this in practice when installing multiple Google API packages, for example:

  $pip_packages = [
    'google-cloud-core',
    'google-cloud-dataflow',
    'google-cloud-storage',
    'google-api-python-client',
  ]

  python::pip { $pip_packages:
    ensure       => latest,
    virtualenv   => $virtual_env_dir,
    owner        => $::user,
  }

And google-api-python-client spuriously matched a bunch of installed packages:

Debug: Executing with ...: 'pip search  google-api-python-client | grep -i INSTALLED | grep -i latest'
Debug: /Stage[main]/Python::Pip[google-api-python-client]/Exec[pip_install_google-api-python-client]/unless:   INSTALLED: 0.0.2 (latest)
Debug: /Stage[main]/Python::Pip[google-api-python-client]/Exec[pip_install_google-api-python-client]/unless:   INSTALLED: 0.5.0 (latest)
Debug: /Stage[main]/Python::Pip[google-api-python-client]/Exec[pip_install_google-api-python-client]/unless:   INSTALLED: 0.7.5 (latest)
Debug: /Stage[main]/Python::Pip[google-api-python-client]/Exec[pip_install_google-api-python-client]/unless:   INSTALLED: 0.22.1 (latest)
Debug: /Stage[main]/Python::Pip[google-api-python-client]/Exec[pip_install_google-api-python-client]/unless:   INSTALLED: 2.6.0 (latest)
Debug: /Stage[main]/Python::Pip[google-api-python-client]/Exec[pip_install_google-api-python-client]/unless:   INSTALLED: 1.6.0 (latest)
Lingua principale
Ruby
Stelle
196
Fork
371
Merge medio
5h 54m
PR unite (30g)
5

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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.

Altre issue di voxpupuli/puppet-python

Tutte le issue di voxpupuli/puppet-python

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.