thomst / django-more-admin-filters

Django-more-admin-filters is a collection of django admin filters with a focus on filters using dropdown widgets, multiple choice filters and filters working with annotated attributes.
BSD 3-Clause "New" or "Revised" License
98 stars 26 forks source link

Support for Django 4.x and Python 3.9/3.10 #16

Closed schferbe closed 1 year ago

schferbe commented 2 years ago

First of all: thank you for providing this nice little lib!

According to the setup.py Django <3.3 and Python up to 3.8 is supported. Are there any plans to support more recent versions of Django and Python?

What is blocking the support as of today?

thomst commented 1 year ago

Hi @schferbe .

I now added support for django-4.0 with version 1.4. Unfortunately running tox raises some errors with django-4.1 with specific python versions: Django-4.1 fails with python-3.8 and -3.9. But works with python-3.7 and -3.10. Some debugging about that will be nesseccery.

So try it yourself with Django-4.1 if needed. Hopefully I find some time soon to add official support for 4.1. Best.

TTycho commented 1 year ago

In the travis logs is says Service geckodriver unexpectedly exited. Is that filter related? What I understand from SO is that it is a version incompatibility with Selenium.

thomst commented 1 year ago

@TTycho : This repository do not longer use travis-ci since travis stopped their free support for open-source projects. CI is now running with github-actions.

TTycho commented 1 year ago

@thomst , I gave it a try. It took me a bit to figure out how testing works but I was at least able to reproduce the error in 4.1: Message: Unable to locate element: li a[title="4"]. But then I got stuck. When adding data myself, I do see this list item on dropdown_lte3. The filter dropdown_gte3 produces a dropdown when more then three items are inserted and I don't see any difference in this behaviour between 3.2, 4.0 and 4.1. I had some trouble inspecting the test data with --keepdb so I can't say if the mock data was added correctly.

Could it be related on how setUpTestData works in 4.1 (see the release notes)?

thomst commented 1 year ago

@TTycho Thank you a lot for trying.

I've now run the tests successfully with django-4.1 and python 3.8, 3.9 and 3.10. I guess the errors came from different dependencies resolving between environments with different python versions. I didn't tracked it down. But I think we should be fine adding 4.1 support now. Thanks for your patience.

thomst commented 1 year ago

Still not done here. My fault - I forgot to change the version constraint within the setup.py. Which means my tests did use django-4.0 instead of django-4.1. Sorry

thomst commented 1 year ago

Django-4.1 changed the way filters are rendered. The filters work fine, but the tests not. Unfortunately it is not easy to fix. I would have to completely rewrite some tests to work with 4.1.

thomst commented 1 year ago

wow. This took me a while. Finally I managed to realise support for django-4.1.

TTycho commented 1 year ago

Fantastic! Thanks for looking into this!