Skip to content

Implement functional interface#157

Merged
bckohan merged 3 commits intomainfrom
functional
Mar 5, 2026
Merged

Implement functional interface#157
bckohan merged 3 commits intomainfrom
functional

Conversation

@bckohan
Copy link
Owner

@bckohan bckohan commented Mar 5, 2026

closes #156

Copilot AI review requested due to automatic review settings March 5, 2026 05:54
Copy link
Contributor

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

Adds support for Python Enum’s functional (dynamic) API to enum-properties, extending it with a properties= keyword so dynamic enums can define named per-member properties at creation time (closes #156).

Changes:

  • Implement EnumPropertiesMeta.__call__ support for EnumProperties("Name", names, properties=(...)) (and related mixins like FlagProperties).
  • Add functional-API test coverage plus a runnable documentation example and how-to docs.
  • Bump package version to 2.6.0 and update changelog/lockfiles.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/enum_properties/__init__.py Adds metaclass __call__ implementation for functional API + version bump.
src/enum_properties/__init__.pyi Minor stub cleanup (removes empty version-guard block).
tests/test_functional.py New tests covering functional API behavior with/without properties and several branches.
tests/examples/howto_functional.py New example module demonstrating functional API usage.
tests/examples/test_examples.py Ensures the new example module imports cleanly.
doc/source/howto.rst New documentation section explaining the functional API extension.
doc/source/reference.rst Exposes __call__ in generated reference docs.
doc/source/changelog.rst Adds a v2.6.0 changelog entry for functional API support.
pyproject.toml Updates project version to 2.6.0.
uv.lock Updates lock revision and enum-properties version.
justfile Removes lock helper recipe and adjusts check recipe composition.

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

@codecov-commenter
Copy link

codecov-commenter commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.22%. Comparing base (81d16cd) to head (b69f063).

Files with missing lines Patch % Lines
src/enum_properties/__init__.py 96.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #157      +/-   ##
==========================================
- Coverage   99.69%   99.22%   -0.48%     
==========================================
  Files           1        1              
  Lines         331      385      +54     
  Branches       66       84      +18     
==========================================
+ Hits          330      382      +52     
- Misses          0        1       +1     
- Partials        1        2       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings March 5, 2026 06:18
Copy link
Contributor

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

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.


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

@bckohan bckohan closed this Mar 5, 2026
@bckohan bckohan reopened this Mar 5, 2026
@bckohan bckohan merged commit e88b45e into main Mar 5, 2026
47 checks passed
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.

Support the Enum functional API.

3 participants