Skip to content

fix(infra): package commitizen plugin entry point#1457

Open
pragnyanramtha wants to merge 1 commit into
i-am-bee:mainfrom
pragnyanramtha:pragnyan/fix-commitizen-entrypoint-1454
Open

fix(infra): package commitizen plugin entry point#1457
pragnyanramtha wants to merge 1 commit into
i-am-bee:mainfrom
pragnyanramtha:pragnyan/fix-commitizen-entrypoint-1454

Conversation

@pragnyanramtha
Copy link
Copy Markdown

@pragnyanramtha pragnyanramtha commented May 20, 2026

Summary

  • include the existing cz_commitizen helper package in the Python wheel so the published Commitizen entry point resolves
  • point the Commitizen plugin entry point at the real implementation class while keeping package import side effects minimal
  • track cz_commitizen/**/*.py as a Python build source

Closes #1454.

Validation

  • uv build --wheel
  • isolated wheel install with commitizen, then cz commit --help
  • isolated wheel install with commitizen, then cz check --message 'fix: packaging test'\n- isolated wheel install with commitizen, then verified commitizen.cz.registry['cz_monorepo_commits'] resolves to cz_commitizen.monorepo_commits.MonorepoCommitsCz and exposes change_type_map\n- inspected the rebuilt wheel to confirm cz_commitizen/__init__.py, cz_commitizen/monorepo_commits.py, and the updated commitizen.plugin entry point are present\n- uv run --no-project --with ruff ruff check cz_commitizen\n- uv run --no-project --with ruff ruff format --check cz_commitizen\n- uv run --no-project --with pyrefly --with commitizen pyrefly check cz_commitizen\n- git diff --check\n\nNote: I could not run the documented mise tasks in this workspace because mise is not installed, so I used the focused build/lint/type/plugin-discovery checks above.

@pragnyanramtha pragnyanramtha requested a review from a team as a code owner May 20, 2026 12:48
Copilot AI review requested due to automatic review settings May 20, 2026 12:48
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 20, 2026
@github-actions github-actions Bot added the python Python related functionality label May 20, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces lazy loading for the MonorepoCommitsCz class and updates the build configuration to include the cz_commitizen package. Key changes include refactoring imports in monorepo_commits.py for better type checking and adding the package to pyproject.toml and tasks.toml. Feedback was provided regarding the proxy class implementation in init.py, noting that using new for lazy loading can hide class attributes and break inheritance checks. It is recommended to use module-level getattr instead to ensure the actual class is returned when accessed.

Comment thread python/cz_commitizen/__init__.py Outdated
Copy link
Copy Markdown

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the Python packaging/build configuration to include a new cz_commitizen package and adjusts Commitizen plugin code to avoid import-time dependencies.

Changes:

  • Extend the build task inputs to watch cz_commitizen/** Python sources.
  • Update Poetry packaging configuration to include both beeai_framework and cz_commitizen.
  • Refactor Commitizen plugin imports (runtime import + TYPE_CHECKING / deferred annotations).

Reviewed changes

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

File Description
python/tasks.toml Adds cz_commitizen to build sources so artifacts rebuild when it changes.
python/pyproject.toml Attempts to configure Poetry to package cz_commitizen alongside beeai_framework.
python/cz_commitizen/monorepo_commits.py Defers commitizen.git import to runtime and uses deferred annotations.
python/cz_commitizen/init.py Changes export of MonorepoCommitsCz to a lazy factory wrapper.

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

Comment thread python/pyproject.toml
Comment thread python/cz_commitizen/__init__.py Outdated
Signed-off-by: pragnyanramtha <pragnyanramtha@gmail.com>
@pragnyanramtha pragnyanramtha force-pushed the pragnyan/fix-commitizen-entrypoint-1454 branch from e91dc16 to caabf18 Compare May 20, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python related functionality size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leaked Commitizen entry point

2 participants