Skip to content

Comments

Upgrade minimum enum_properties version to 2.5.1#159

Merged
bckohan merged 1 commit intomainfrom
auto
Feb 11, 2026
Merged

Upgrade minimum enum_properties version to 2.5.1#159
bckohan merged 1 commit intomainfrom
auto

Conversation

@bckohan
Copy link
Member

@bckohan bckohan commented Feb 10, 2026

fixes #146

Copilot AI review requested due to automatic review settings February 10, 2026 01:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the project’s optional properties extra to require enum-properties>=2.5.1, addressing issue #146 where enum.auto() failed for enums derived from django_enum.choices.TextChoices.

Changes:

  • Bump the minimum enum-properties version for the properties optional dependency to >=2.5.1.
  • Add a regression test covering auto() behavior for TextChoices, including _generate_next_value_ override behavior.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Raises the minimum enum-properties version for the properties extra to ensure auto() works with Choices-derived enums.
tests/test_auto.py Adds regression coverage for auto() with django_enum.choices.TextChoices, including label and extra property handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

self.assertEqual(MyTextChoices.BAR.custom_value, "bar123")

class MyTextChoicesAutoOverride(TextChoices):
def _generate_next_value_(name, start, count, last_values):
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Normal methods should have 'self', rather than 'name', as their first parameter.

Copilot uses AI. Check for mistakes.
@bckohan bckohan merged commit 57ae280 into main Feb 11, 2026
39 of 41 checks passed
@bckohan bckohan deleted the auto branch February 11, 2026 03:58
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.

auto() does not work with enums derived from Django's Choices

1 participant