Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MaxMind database files to Git #177

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/example/database.sqlite3
/example/GeoLiteCity.dat
/django_user_sessions.egg-info/
/tests/test_city.mmdb
/tests/test_country.mmdb

/htmlcov/

Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: local
hooks:
- id: generate-mmdb-fixtures
name: Regenerate MaxMind database files
language: system
entry: make tests/test_city.mmdb tests/test_country.mmdb
always_run: true
pass_filenames: false
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ check:
DJANGO_SETTINGS_MODULE=example.settings PYTHONPATH=. \
python -Wd example/manage.py check

generate-mmdb-fixtures:
tests/test_city.mmdb: tests/Dockerfile tests/generate_mmdb.pl
docker --context=default buildx build -f tests/Dockerfile --tag test-mmdb-maker tests
docker run --rm --volume $$(pwd)/tests:/data test-mmdb-maker

test: generate-mmdb-fixtures
tests/test_country.mmdb: tests/Dockerfile tests/generate_mmdb.pl
docker --context=default buildx build -f tests/Dockerfile --tag test-mmdb-maker tests
docker run --rm --volume $$(pwd)/tests:/data test-mmdb-maker

test: tests/test_city.mmdb tests/test_country.mmdb
DJANGO_SETTINGS_MODULE=tests.settings PYTHONPATH=. \
django-admin.py test ${TARGET}

Expand Down
Binary file added tests/test_city.mmdb
Binary file not shown.
Binary file added tests/test_country.mmdb
Binary file not shown.
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ DJANGO =

[testenv]
commands =
make generate-mmdb-fixtures
coverage run {envbindir}/django-admin test -v 2 --pythonpath=./ --settings=tests.settings
coverage report
coverage xml
Expand All @@ -41,4 +40,3 @@ deps =
geoip2
ignore_outcome =
djmain: True
allowlist_externals = make
Loading