#36272: [MacOS] geoip aka libgeoip disabled on 2024-12-12
-------------------------------------+-------------------------------------
Reporter: Felipe Villegas | Owner: (none)
Type: Bug | Status: new
Component: GIS | Version: 5.1
Severity: Normal | Resolution:
Keywords: geoip, libgeoip, | Triage Stage: Accepted
geodjango |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jon Culver):
Best I can tell, [
https://github.com/Homebrew/homebrew-
core/pull/258452/files geoip] (aliased as `libgeoip`) just referred to
[
https://github.com/maxmind/geoip-api-c a C extension], which read the
now-deprecated `.dat` database format, but that repo was archived in June
2022, when MaxMind retired the legacy databases. For modern use with
MaxMind's newer `.mmdb` file format, the relevant library is
[
https://github.com/maxmind/libmaxminddb libmaxminddb], which
[
https://formulae.brew.sh/formula/libmaxminddb can be installed via
Homebrew]. However:
1. It's just an optional performance optimization. The `geoip2` Python
package
[
https://github.com/maxmind/GeoIP2-python/blob/main/src/geoip2/database.py#L113-L121
falls back to a pure Python implementation if the C library isn't found];
2. `geoip2`
[
https://github.com/maxmind/GeoIP2-python/blob/main/pyproject.toml#L10C6-L10C15
depends on] the Python package `maxminddb`; which, most importantly:
3. `libmaxminddb` is compiled on install of `maxminddb` unless you
intentionally opt out. See [
https://github.com/maxmind/MaxMind-DB-Reader-
python/blob/main/setup.py#L21-L58 setup.py].
**TL/DR**: A documentation change looks to be the right call here, just so
folks don't run into that error. Removing `brew install libgeoip` seems
the most pragmatic, since it's already included.
I had to type this out to keep all my thinking in order :) additional
reads or clarifications certainly welcome.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36272#comment:4>