Skip to content

Commit e91dc16

Browse files
fix(infra): package commitizen plugin entry point
Signed-off-by: pragnyanramtha <pragnyanramtha@gmail.com>
1 parent c8f77bb commit e91dc16

4 files changed

Lines changed: 24 additions & 5 deletions

File tree

python/cz_commitizen/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Copyright 2025 © BeeAI a Series of LF Projects, LLC
22
# SPDX-License-Identifier: Apache-2.0
33

4-
from cz_commitizen.monorepo_commits import MonorepoCommitsCz
4+
from typing import Any
5+
6+
7+
class MonorepoCommitsCz:
8+
def __new__(cls, *args: Any, **kwargs: Any) -> Any:
9+
from cz_commitizen.monorepo_commits import MonorepoCommitsCz as _MonorepoCommitsCz
10+
11+
return _MonorepoCommitsCz(*args, **kwargs)
12+
513

614
__all__ = ["MonorepoCommitsCz"]

python/cz_commitizen/monorepo_commits.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# Copyright 2025 © BeeAI a Series of LF Projects, LLC
22
# SPDX-License-Identifier: Apache-2.0
33

4+
from __future__ import annotations
5+
46
from collections.abc import Iterable
5-
from typing import Any
7+
from typing import TYPE_CHECKING, Any
68

7-
from commitizen import git
89
from commitizen.cz.conventional_commits import ConventionalCommitsCz # type: ignore
910

1011
__all__ = ["MonorepoCommitsCz"]
1112

12-
from commitizen.question import CzQuestion
13+
if TYPE_CHECKING:
14+
from commitizen import git
15+
from commitizen.question import CzQuestion
1316

1417

1518
class MonorepoCommitsCz(ConventionalCommitsCz):
@@ -24,6 +27,8 @@ class MonorepoCommitsCz(ConventionalCommitsCz):
2427
def changelog_message_builder_hook(
2528
self, parsed_message: dict[str, Any], commit: git.GitCommit
2629
) -> dict[str, Any] | Iterable[dict[str, Any]] | None:
30+
from commitizen import git
31+
2732
changed_files = git.get_filenames_in_commit(commit.rev) or []
2833

2934
has_python_changes = any(file.startswith("python/") for file in changed_files)

python/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ homepage = "https://framework.beeai.dev/"
1616
repository = "https://github.com/i-am-bee/beeai-framework"
1717
documentation = "https://i-am-bee.github.io/beeai-framework/#/python/"
1818

19+
[tool.poetry]
20+
packages = [
21+
{ include = "beeai_framework" },
22+
{ include = "cz_commitizen" },
23+
]
24+
1925
[tool.poetry.dependencies]
2026
python = ">= 3.11,<3.14"
2127
a2a-sdk = {version = "^0.3.9", optional = true, extras = ["grpc", "http-server", "telemetry"]}

python/tasks.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ outputs = { auto = true }
8282
depends = ["python:setup"]
8383
dir = "{{config_root}}/python"
8484
run = "rm -rf build dist 2>/dev/null; poetry build"
85-
sources = ["beeai_framework/**/*.py"]
85+
sources = ["beeai_framework/**/*.py", "cz_commitizen/**/*.py"]
8686
outputs = { auto = true }
8787

8888
# test

0 commit comments

Comments
 (0)