Skip to content

Conversation

Copy link

Copilot AI commented Jan 27, 2026

Progress Plan

  • Add missing UIClassifier enum to exports
  • Remove redundant enum conversion in create_server_config (rely on ServerConfig.init)
  • Verify all linting and type checking passes
  • Test functionality works correctly

Changes

This PR addresses code review feedback on the enum refactoring by:

  1. Replacing wildcard imports with explicit enum re-exports in pyoverkiz/enums/__init__.py

    • Exports all 23 enum classes via explicit imports (including previously missing UIClassifier)
    • Eliminates namespace pollution (StrEnum, Enum, unique, etc. no longer leak into package)
    • Maintains backward compatibility for all import styles
  2. Simplifying enum conversion in pyoverkiz/utils.py

    • create_server_config() passes values directly to ServerConfig
    • Relies on ServerConfig.__init__() to handle string → enum conversion internally
    • Uses # type: ignore[arg-type] comments for mypy compatibility

Testing

  • ✅ All ruff linting checks pass
  • ✅ All mypy type checks pass (27 source files)
  • ✅ Functional tests confirm all 23 enums import and work correctly
  • create_server_config() properly converts strings to enums via ServerConfig.__init__()
  • ✅ No namespace pollution

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 27, 2026 23:49
- Replace wildcard imports with explicit enum re-exports in __init__.py
- Remove redundant enum conversion logic in create_server_config (ServerConfig.__init__ already handles it)
- Add type: ignore comments for mypy limitations with attrs constructors

Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 27, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor enum structure by adding shared mixin Address code review feedback: fix import pollution and remove redundant enum conversion Jan 27, 2026
Copilot AI requested a review from iMicknl January 27, 2026 23:56
@iMicknl iMicknl marked this pull request as ready for review January 27, 2026 23:58
@iMicknl iMicknl requested a review from tetienne as a code owner January 27, 2026 23:58
Copilot AI review requested due to automatic review settings January 27, 2026 23:58
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

Refactors enum exports and server config creation to address review feedback by reducing namespace pollution from wildcard imports and removing duplicated enum coercion logic.

Changes:

  • Replaced pyoverkiz/enums/__init__.py wildcard imports with explicit enum re-exports via a fixed __all__ list.
  • Simplified create_server_config() in pyoverkiz/utils.py by removing local string→enum conversion and adding type: ignore markers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pyoverkiz/utils.py Removes local enum coercion when constructing ServerConfig.
pyoverkiz/enums/init.py Switches to explicit re-exports to prevent leaking helper/imported names into pyoverkiz.enums.

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

- Add UIClassifier to enum exports (was accidentally omitted)
- Restore explicit enum conversion in create_server_config for type safety
- While ServerConfig.__init__ does convert, explicit conversion is safer and clearer

Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
Remove the explicit enum conversion in create_server_config and rely on ServerConfig.__init__ to handle the conversion. This is the cleaner approach preferred by the maintainer.

Co-authored-by: iMicknl <1424596+iMicknl@users.noreply.github.com>
@iMicknl iMicknl merged commit d032395 into v2/enums Jan 28, 2026
@iMicknl iMicknl deleted the copilot/sub-pr-1925 branch January 28, 2026 08:42
Copilot AI restored the copilot/sub-pr-1925 branch January 28, 2026 08:43
Copilot AI changed the title Address code review feedback: fix import pollution and remove redundant enum conversion Address code review feedback: fix import pollution and add missing UIClassifier enum Jan 28, 2026
Copilot AI requested a review from iMicknl January 28, 2026 08:43
Copilot stopped work on behalf of iMicknl due to an error January 28, 2026 08:43
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.

2 participants