feat: update pyproject.toml to specify wheel targets

Added a new section to the pyproject.toml file to include only specific files in the wheel build, enhancing the packaging process. Updated tests to verify the inclusion of these targets.
This commit is contained in:
Joao Moura
2026-06-17 23:15:51 -07:00
parent c0fa66d182
commit 6c82b0c735
2 changed files with 9 additions and 0 deletions

View File

@@ -96,6 +96,9 @@ dependencies = [
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
only-include = ["agents", "crew.jsonc", "tools", "knowledge", "skills"]
[tool.crewai]
type = "crew"
"""

View File

@@ -5,6 +5,7 @@ from pathlib import Path
from unittest import mock
import pytest
import tomli
from click.testing import CliRunner
import crewai_cli.create_json_crew as json_crew
import crewai_cli.tui_picker as tui_picker
@@ -712,6 +713,11 @@ def test_json_create_provider_preselects_default_model(tmp_path, monkeypatch):
assert not (tmp_path / "json_crew" / "tests").exists()
assert not (tmp_path / "json_crew" / "config.jsonc").exists()
pyproject = tomli.loads((tmp_path / "json_crew" / "pyproject.toml").read_text())
assert pyproject["tool"]["hatch"]["build"]["targets"]["wheel"][
"only-include"
] == ["agents", "crew.jsonc", "tools", "knowledge", "skills"]
crew_template = (tmp_path / "json_crew" / "crew.jsonc").read_text()
assert (
'"guardrail": "Every factual claim needs context support."'