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

Update Django/Python support #458

Closed

Conversation

browniebroke
Copy link
Contributor

@browniebroke browniebroke commented Feb 16, 2025

  • Add support for Python 3.12
  • Add support for Django 5.1
  • Add support for Python 3.13
  • Drop support for Python 3.7 and 3.8
  • Drop support for Django 3.2 - 4.1

EDIT: perhaps duplicated with #456

Fix #420

@browniebroke browniebroke force-pushed the update/django-python-support branch from a44b7a9 to 9033da2 Compare February 16, 2025 12:38
@browniebroke browniebroke force-pushed the update/django-python-support branch from bf04f86 to 146e65a Compare February 16, 2025 12:46
@browniebroke browniebroke marked this pull request as ready for review February 16, 2025 12:46
@@ -1,4 +1,3 @@
case>=1.3.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one might deserve its own separate PR... Thoughts?

t/conftest.py Outdated
"""
return _patching(monkeypatch, request)


@pytest.fixture(autouse=True)
def test_cases_shortcuts(request, app, patching):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, the patching fixture was only thing that was coming from the case dependency. I took the current implementation from Celery (found here celery/celery#7077)

Not sure if duplicating these ~100 lines of code is the best way forward but that does the job

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might be using that from celery instead of case if those are already available there

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or we can handle this in a separate PR

Copy link
Contributor Author

@browniebroke browniebroke Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version from Celery is defined under the tests directory (celery/t), which not included in the wheel distribution, so it's not available in the version we have installed... I tried to install from the source distribution, which seems to have the t directory included, but couldn't get to import the fixture.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I have 2 approaches:

  1. Extract the commit as is from this PR Remove case dependency and copy Celery fixture #462 - just works but fixture is duplicated with Celery
  2. Use the fixture from Celery PoC: Remove case dependency and use Celery fixture #461 - not working right now, so I assume it needs more work in Celery... Perhaps move the fixture from t to under celery to be included in the distribution, but I'm not sure about the side effects of doing so.

Approach 1 is more practical, and can unblock this PR immediately. Approach 2 is more purist but needs more work and guidance from one of the Celery maintainers.

@Nusnus Nusnus self-requested a review February 16, 2025 14:08
t/conftest.py Outdated
"""
return _patching(monkeypatch, request)


@pytest.fixture(autouse=True)
def test_cases_shortcuts(request, app, patching):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or we can handle this in a separate PR

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this PR. I will take parts from this PR for keeping older versions for a new release, to let the old users easier path to upgrade

@browniebroke
Copy link
Contributor Author

browniebroke commented Mar 4, 2025

thanks for this PR. I will take parts from this PR for keeping older versions for a new release, to let the old users easier path to upgrade

I added support before dropping so I think I can easily rebase and split this in 2 PRs if you want?

EDIT: right I just saw that #456 was merged in the meantime... What is your plan in terms of adding and removing support?

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.

Django 5 support
2 participants