mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-04 14:39:23 +00:00
Moves the registry/cache pieces of PR #5867 under crewai.experimental.skills and the CLI commands under `crewai experimental skill`. The stable local-file skills feature (loader, parser, validation, models) stays in crewai.skills. Both entry points now require CREWAI_EXPERIMENTAL=1: - resolve_registry_ref() calls require_experimental_skills() before resolving - The `crewai experimental` CLI group raises UsageError when the flag is unset SkillDownloadStarted/CompletedEvent move out of crewai.events.types.skill_events into crewai.experimental.skills.events. * refactor(skills): move 'version' off SkillFrontmatter into metadata The skill version is now stored as `metadata.version` rather than a top-level field on `SkillFrontmatter`. A `before` validator lifts any top-level YAML `version:` into `metadata['version']` so existing SKILL.md files keep parsing.
30 lines
975 B
Python
30 lines
975 B
Python
"""Tests for the CREWAI_EXPERIMENTAL gate on Skills Repository."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from crewai.experimental.skills._flag import (
|
|
ExperimentalFeatureDisabledError,
|
|
require_experimental_skills,
|
|
)
|
|
from crewai.experimental.skills.registry import resolve_registry_ref
|
|
|
|
|
|
def test_require_raises_without_flag(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
monkeypatch.delenv("CREWAI_EXPERIMENTAL", raising=False)
|
|
with pytest.raises(ExperimentalFeatureDisabledError):
|
|
require_experimental_skills()
|
|
|
|
|
|
def test_resolve_registry_ref_raises_without_flag(
|
|
monkeypatch: pytest.MonkeyPatch,
|
|
) -> None:
|
|
monkeypatch.delenv("CREWAI_EXPERIMENTAL", raising=False)
|
|
with pytest.raises(ExperimentalFeatureDisabledError):
|
|
resolve_registry_ref("@acme/my-skill")
|
|
|
|
|
|
def test_require_passes_with_flag(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
monkeypatch.setenv("CREWAI_EXPERIMENTAL", "1")
|
|
require_experimental_skills() |