EarthView: read key from GOOGLE_MAPS_API_KEY to avoid clash with Gemini's GOOGLE_API_KEY
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- computer-vision
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 223
- Forks
- 30
- Merge medio
- 1 h 4 min
- PR fusionados (30 d)
- 9
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de petercorke/machinevision-toolbox-python
-
tech-debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
petercorke/machinevision-toolbox-python#122 ·
Los mantenedores suelen responder en 1 día
-
tech-debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
petercorke/machinevision-toolbox-python#119 ·
Los mantenedores suelen responder en 1 día
-
tech-debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
petercorke/machinevision-toolbox-python#117 ·
Los mantenedores suelen responder en 1 día
-
Remaining bare `except:` / swallowed exceptions in tests/ and src/ (Codacy + hidden failures)Abiertotech-debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
petercorke/machinevision-toolbox-python#115 ·
Los mantenedores suelen responder en 1 día
-
tech-debt
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
petercorke/machinevision-toolbox-python#113 ·
Los mantenedores suelen responder en 1 día
Todos los issues de petercorke/machinevision-toolbox-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
UKGovernmentBEIS/inspect_ai#5781 ·
Los mantenedores suelen responder en 2 días
-
Bump .cicd to wamp-cicd 4c2f9ac: `just land` refuses open A18 decisions, `just where` lists themAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
crossbario/cfxdb#139 ·
-
Bump .cicd to wamp-cicd 4c2f9ac: `just land` refuses open A18 decisions, `just where` lists themAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
crossbario/txaio#241 ·
-
UX
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
mediajunkie/piper-morgan-product#1963 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100