EarthView: read key from GOOGLE_MAPS_API_KEY to avoid clash with Gemini's GOOGLE_API_KEY
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- computer-vision
Rechercherichtung
Review Sources.py and EarthView.__init__, then run the TestEarthViewKey tests in tests/test_image_sources.py. The issue says the change is already implemented on fix/earthview-maps-key-env; rebase on main if needed, open a PR, and check the RVC3 text and notebooks for instructions that still recommend GOOGLE_API_KEY. Done means the PR is opened and those instructions are updated where necessary.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
EarthView reads its Google Maps key only from the GOOGLE_API_KEY environment variable (Sources.py, EarthView.__init__). That is also the first name Google's Gemini libraries (google-genai) check, so anyone with both a Maps key and a Gemini key can only satisfy one of them: whichever key is in GOOGLE_API_KEY, the other tool gets the wrong one.
Proposed fix
Read GOOGLE_MAPS_API_KEY first, falling back to GOOGLE_API_KEY so existing setups keep working:
self.key = os.getenv("GOOGLE_MAPS_API_KEY") or os.getenv("GOOGLE_API_KEY")
and update the docstring to explain the lookup order, recommend GOOGLE_MAPS_API_KEY, and advise restricting the key to the Maps Static API with a daily quota (an unrestricted Maps key that leaks can run up charges).
Status
Implemented and tested on branch fix/earthview-maps-key-env (commit 4e12d1b), not yet opened as a PR:
EarthView.__init__lookup changed as above, docstring updated- 4 new tests in
tests/test_image_sources.py(TestEarthViewKey): Maps key preferred,GOOGLE_API_KEYfallback, explicitkey=wins, no key givesNone; no network access needed tests/test_image_sources.pypasses (13 passed, 20 skipped for optional extras) in a clean venv
Possible follow-up
With no key at all, self.key is None and the failure only shows up later as an HTTP error from Google. A clear error at construction time (or on first grab) naming both environment variables would be friendlier.
To finish
Open a PR from the branch (rebase on main first if it has moved), and update the RVC3 text/notebooks if they tell readers to set GOOGLE_API_KEY.
- Vorherrschende Sprache
- Python
- Sterne
- 224
- Forks
- 35
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 34
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus petercorke/machinevision-toolbox-python
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 76/100
petercorke/machinevision-toolbox-python#160 ·
Maintainer antworten meist innerhalb von 1 Tag
-
tech-debt
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 39/100
petercorke/machinevision-toolbox-python#159 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 42/100
petercorke/machinevision-toolbox-python#157 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
petercorke/machinevision-toolbox-python#152 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ROSBag: RealSense bags have a 4-byte depth-units trailer that is guessed, not parsedEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenbug help wanted
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
petercorke/machinevision-toolbox-python#151 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in petercorke/machinevision-toolbox-python
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
GoogleCloudPlatform/gce-rescue#195 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
intake mcp-intake needs-ac needs-human-review priority:medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
Ikalus1988/MisakaNet#3848 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
521xueweihan/HelloGitHub#4105 ·
-
bug size:XS
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag