-
Notifications
You must be signed in to change notification settings - Fork 77
Add Django 6 compatibility and modernise codebase #105
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
base: master
Are you sure you want to change the base?
Add Django 6 compatibility and modernise codebase #105
Conversation
|
I could imagine having a new major release with support for only the last LTS of Django. No need to build a lot of compat code. Any help would be more than appreciated :) Feel free to udpate this PR introducing a new major release + required changes in testing/code. Thank you so much! |
Hi @stephrdev I've made these changes. I also felt like Docker compose would be preferred at this stage to Vagrant, as it allows easy reloading of Django by binding the sandbox directory to the container as a volume. Let me know if you disagree with this change. Other changes include
Tests are working in Github Actions on my repo and the sandbox seems to be fully functional. Let me know if you have any questions. |
stephrdev
left a comment
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.
Really great work. Thank you for contributing to this project! Only a few minor notes. But I think we can get this merged even before the holidays :)
|
|
||
| python: | ||
| version: 3.8 | ||
| version: 3.10 |
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.
Wouldn't it make sense to upgrade to 3.14 right away?
| set -xe | ||
| python -m pip install --upgrade pip setuptools | ||
| python -m pip install --upgrade poetry tox tox-gh-actions | ||
| pip install --user poetry-plugin-export |
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.
You cann add the extra install to the line above where we install poetry.
| # -------------- | ||
|
|
||
| @staticmethod | ||
| def is_iterable(value): |
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.
As we only use it once, I'd not have it as a separate method, especially not as a staticmethod :)
| condition: service_healthy | ||
|
|
||
| redis: | ||
| image: redis:7-alpine |
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.
| image: redis:7-alpine | |
| image: redis:8-alpine |
| Or you can run the RQ implementation:: | ||
|
|
||
| $ honcho -f Procfile.rq start | ||
| $ Q=rq docker compose up |
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.
| $ Q=rq docker compose up | |
| $ QUEUE=rq docker compose up |
Lets make it more verbose.
| @@ -0,0 +1,20 @@ | |||
| FROM python:3.12-slim | |||
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.
| FROM python:3.12-slim | |
| FROM python:3.14-slim |
| && apt-get install -y --no-install-recommends build-essential \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN pip install --upgrade pip \ |
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.
| RUN pip install --upgrade pip \ | |
| RUN set -ex \ | |
| && pip install --upgrade pip \ |
| ) | ||
|
|
||
| INTERNAL_IPS = ('10.0.2.2',) | ||
| _, _, ips = socket.gethostbyname_ex(socket.gethostname()) |
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.
| _, _, ips = socket.gethostbyname_ex(socket.gethostname()) | |
| ips = socket.gethostbyname_ex(socket.gethostname())[2] |
| CACHEBACK_TASK_QUEUE = dict([(q, q) for q in ('celery', 'rq')]).get( | ||
| os.environ.get('QUEUE', ''), 'celery') | ||
| CACHEBACK_TASK_QUEUE = {q: q for q in ('celery', 'rq')}.get( | ||
| os.environ.get('Q', ''), 'celery') |
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.
| os.environ.get('Q', ''), 'celery') | |
| os.getenv('QUEUE', ''), 'celery') |
Hello.
Django 5.1 deprecated the undocumented
django.utils.itercompatmodule. Django 6.0 removed it entirely, which leads to this package breaking when imported.@stephrdev / @codeinthehole Many components of this project are quite outdated at this point. Is there interest in getting things up to date? If so, would it be best to retain compatibility with EOL versions of Python and Django, or create a version 4.0 which only supports Django 5.2+ / Python 3.10+?