-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Django_v5.0 #1915
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
Django_v5.0 #1915
Conversation
haystack/fields.py
Outdated
try: # datetime_safe was removed in Django 5.0 | ||
from django.utils import datetime_safe | ||
except ImportError: | ||
import datetime as datetime_safe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at how Django made this replacement in its own code in django/django@46346f8ea0802, it looks like it is always related to producing strftime
ouptut, which is not the case in that file. So I would simply replace this by import datetime
and replacing datetime_safe
occurrences later in the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is always difficult to be confident about making changes to a project that is failing its CI. I have taken a lot of runs at fixing this project's GitHub Actions but cannot seem to find the magic combination.
I have been using this branch to get all pytests of my main project to pass...
Pipfile
:
# django-haystack = "*" # Currently incompatible with Django 5.0
django-haystack = {git = "https://github.com/cclauss/django-haystack.git@Django_v5"}
but now that they are passing, let's try todo as you suggest above.
%
I did not change these instances because https://pypi.org/project/Whoosh has not been updated since 2016 and points to a nonexistent BitBucket repo however https://github.com/mchaput/whoosh still exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, i think it's a safe change.
I followed your trials to make the test suite pass, thanks so much. I guess I'll need to pray more so we finally find a way through :-)
https://docs.djangoproject.com/en/5.0/releases/5.0/#features-removed-in-5-0
Any Django 5 projects that
import haystack
will fail without this change.