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 support for Django 5.0 and 5.1, along with Python 3.13 #190

Closed

Conversation

browniebroke
Copy link
Member

Description

Update CI config to run tests against 5.0 and 5.1 + Python 3.13. Declare official support in Trove classifiers and update docs in readme.

Motivation and Context

Keep up to date with Django ecosystem.

How Has This Been Tested?

Existing test suite, updated dependencies in tox file.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.24%. Comparing base (e2bf17e) to head (1e5a5c3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #190      +/-   ##
==========================================
+ Coverage   97.22%   97.24%   +0.01%     
==========================================
  Files          24       25       +1     
  Lines         721      726       +5     
  Branches       56       29      -27     
==========================================
+ Hits          701      706       +5     
  Misses         14       14              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@browniebroke
Copy link
Member Author

Ok, the test failures seem related to this deprecation in Django 5.1:

GeoIP2 no longer opens both city and country databases when a directory path is provided, preferring the city database, if it is available. The country database is a subset of the city database and both are not typically needed. If you require use of the country database when in the same directory as the city database, explicitly pass the country database path to the constructor.

https://docs.djangoproject.com/en/5.1/releases/5.1/#id1

I can see that the underlying database is just the city one (<GeoIP2 [v2.0] _path='.../django-user-sessions/tests/test_city.mmdb'>) instead of both the city and the country ones with Django <5.1 (<GeoIP2 [v2.0] _country_file=".../django-user-sessions/tests/test_country.mmdb", _city_file=".../django-user-sessions/tests/test_city.mmdb">)

@browniebroke browniebroke marked this pull request as ready for review October 24, 2024 17:08
@browniebroke
Copy link
Member Author

The failures were due to the test DB it seems: https://forum.djangoproject.com/t/geoip-country-lookup-change-in-django-5-1/35885/3

Might want to review how the test DB is built, but that's perhaps a wider discussion, for now I've updated the tests to accommodate the new behaviour from Django 5.1

@browniebroke
Copy link
Member Author

#123 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant