Skip to content

Misc: Django 5.2 update #3

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

thmsrmbld
Copy link

@thmsrmbld thmsrmbld commented May 22, 2025

Django 5.2 Compatibility Update

This PR updates the project to support Django 5.2 and makes several modernization improvements.

Changes

  1. Added Django 5.2 compatibility
  2. Deprecated support for Django versions before 4.2 (removing 3.2, 4.0, 4.1)
  3. Updated tox configuration to test against supported Django versions
  4. Ensured Django main branch is only tested on Python 3.12
  5. Updated GitHub Actions workflow matrix to reflect Django version changes

Also: Addressed an issue where tests were failing in Django 5.2 due to a change in output handling. In previous Django versions, writelines() would implicitly add newlines between elements. But Django 5.2 aligns with Python's standard behavior where it doesn't. Fixed by explicitly adding newlines when outputting content in the print_contents() method of DiffCheckCommand, ensuring consistent behavior across all supported Django versions and keeping the test passing.

Tooling Improvements

  1. Updated ruff commands to use modern ruff check syntax
  2. Modernized ruff configuration in .ruff.toml to use new section-based format
  3. Updated pre-commit configuration to add explicit ruff check hooks

Documentation

  1. Updated README with compatibility information
  2. Updated CHANGELOG to document version 0.4 changes
  3. Bumped project version from 0.3 to 0.4 in pyproject.toml
  4. Updated pyproject.toml classifiers to reflect supported Django versions

@thmsrmbld thmsrmbld self-assigned this May 22, 2025
@thmsrmbld thmsrmbld added the enhancement New feature or request label May 22, 2025
@thmsrmbld thmsrmbld force-pushed the misc/updates-52-django branch from 75249f2 to 60d9ce4 Compare May 22, 2025 14:18
@@ -86,7 +86,8 @@ def print_contents(self, contents: list[str]) -> None:
"""Dump the contents to stdout."""
if contents:
self.stdout.write("--- Contents ---")
self.stdout.writelines(contents)
Copy link
Author

@thmsrmbld thmsrmbld May 22, 2025

Choose a reason for hiding this comment

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

Addresses an issue where tests were failing in Django 5.2 due to a change in output handling. In previous Django versions, writelines() would implicitly add newlines between elements. But Django 5.2 aligns with Python's standard behavior where it doesn't. Fixed by explicitly adding newlines when outputting content in the print_contents() method of DiffCheckCommand, ensuring consistent behavior across all supported Django versions and keeping the test passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant