django-rules icon indicating copy to clipboard operation
django-rules copied to clipboard

Update django 4.2 support

Open irtazaakram opened this issue 2 years ago • 4 comments

Hi,

I've made this PR that

  • Add support for Django 4.1, 4.2
  • Drop support for Django 4.0, 2.2 EOL https://www.djangoproject.com/download/#unsupported-versions
  • Drop support for Python 3.7 EOL https://devguide.python.org/versions/#unsupported-versions
  • Drop support for PyPy and PyPy3

Can we also have a new release if this PR is merged?

Thanks,

Ref: https://github.com/edx/upgrades/issues/310

irtazaakram avatar Jul 18 '23 09:07 irtazaakram

Hi, thanks for the PR. Why drop tests for Pypy?

dfunckt avatar Jul 19 '23 07:07 dfunckt

Hi @dfunckt,

Coverage seems to not work with pypy3. I kept getting this error

pypy3-django32 run-test: commands[0] | coverage run tests/manage.py test testsuite -v 2
Traceback (most recent call last):
  File "/home/runner/work/django-rules/django-rules/tests/manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
  File "/home/runner/work/django-rules/django-rules/.tox/pypy3-django32/lib/pypy3.9/site-packages/django/core/management/__init__.py", line 13, in <module>
    from django.apps import apps
  File "/home/runner/work/django-rules/django-rules/.tox/pypy3-django32/lib/pypy3.9/site-packages/django/apps/__init__.py", line 1, in <module>
    from .config import AppConfig
  File "/home/runner/work/django-rules/django-rules/.tox/pypy3-django32/lib/pypy3.9/site-packages/django/apps/config.py", line 7, in <module>
    from django.utils.deprecation import RemovedInDjango41Warning
  File "/home/runner/work/django-rules/django-rules/.tox/pypy3-django32/lib/pypy3.9/site-packages/django/utils/deprecation.py", line 5, in <module>
    from asgiref.sync import sync_to_async
  File "/home/runner/work/django-rules/django-rules/.tox/pypy3-django32/lib/pypy3.9/site-packages/asgiref/sync.py", line 130, in <module>
    class AsyncToSync(Generic[_P, _R]):
  File "/opt/hostedtoolcache/PyPy/3.9.17/x64/lib/pypy3.9/typing.py", line 277, in inner
    return func(*args, **kwds)
  File "/opt/hostedtoolcache/PyPy/3.9.17/x64/lib/pypy3.9/typing.py", line 997, in __class_getitem__
    raise TypeError(
TypeError: Parameters to Generic[...] must all be type variables

Couldn't found any workaround for this.

I can add back tests if we can avoid coverage with pypy3

[testenv:pypy3]
commands =
    {envpython} tests/manage.py test testsuite {posargs: -v 2}

Let me know your thoughts on this.

irtazaakram avatar Jul 21 '23 05:07 irtazaakram

Since Django 5.0 was released a month ago, would it make sense to also add support for it with this? same with Python 3.12

Zerotask avatar Jan 13 '24 12:01 Zerotask

Submitted #179 which supersedes this, includes Django 5.0 , Python 3.12 and doesn't disable pypy tests.

georgek avatar Jan 17 '24 14:01 georgek

Closing this in favor of #179. Big thanks to everyone involved! 🎉

federicobond avatar Mar 24 '24 00:03 federicobond