diff --git a/pyproject.toml b/pyproject.toml index 52d65a7bb..d639c3cbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "crewai" -version = "0.134.0" +dynamic = ["version"] description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks." readme = "README.md" requires-python = ">=3.10,<3.14" @@ -117,6 +117,9 @@ torchvision = [ { index = "pytorch", marker = "python_version < '3.13'" }, ] +[tool.hatch.version] +path = "src/crewai/__init__.py" + [build-system] requires = ["hatchling"] build-backend = "hatchling.build" diff --git a/src/crewai/__init__.py b/src/crewai/__init__.py index 6c91a23a3..9545675b1 100644 --- a/src/crewai/__init__.py +++ b/src/crewai/__init__.py @@ -31,4 +31,5 @@ __all__ = [ "Knowledge", "TaskOutput", "LLMGuardrail", + "__version__", ] diff --git a/tests/cli/test_version.py b/tests/cli/test_version.py new file mode 100644 index 000000000..9706a282d --- /dev/null +++ b/tests/cli/test_version.py @@ -0,0 +1,17 @@ +"""Test for version management.""" + +from crewai import __version__ +from crewai.cli.version import get_crewai_version + + +def test_dynamic_versioning_consistency(): + """Test that dynamic versioning provides consistent version across all access methods.""" + cli_version = get_crewai_version() + package_version = __version__ + + # Both should return the same version string + assert cli_version == package_version + + # Version should not be empty + assert package_version is not None + assert len(package_version.strip()) > 0 diff --git a/tests/test_lite_agent.py b/tests/test_lite_agent.py index 0a8da236d..6b0ca4b70 100644 --- a/tests/test_lite_agent.py +++ b/tests/test_lite_agent.py @@ -192,7 +192,7 @@ def test_lite_agent_structured_output(): ) result = agent.kickoff( - "What is the population of Tokyo? Return your strucutred output in JSON format with the following fields: summary, confidence", + "What is the population of Tokyo? Return your structured output in JSON format with the following fields: summary, confidence", response_format=SimpleOutput, ) @@ -230,7 +230,7 @@ def test_lite_agent_returns_usage_metrics(): ) result = agent.kickoff( - "What is the population of Tokyo? Return your strucutred output in JSON format with the following fields: summary, confidence" + "What is the population of Tokyo? Return your structured output in JSON format with the following fields: summary, confidence" ) assert result.usage_metrics is not None @@ -252,7 +252,7 @@ async def test_lite_agent_returns_usage_metrics_async(): ) result = await agent.kickoff_async( - "What is the population of Tokyo? Return your strucutred output in JSON format with the following fields: summary, confidence" + "What is the population of Tokyo? Return your structured output in JSON format with the following fields: summary, confidence" ) assert isinstance(result, LiteAgentOutput) assert "21 million" in result.raw or "37 million" in result.raw