Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,68 @@ jobs:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
fail_ci_if_error: true

CLI-Compatibility:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
typer-version: ["0.16.0", "0.17.0", "0.18.0", "0.19.2"]
click-version: ["8.1.0", "8.2.0", "8.3.0"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install Dependencies with specific typer and click versions
run: |
# Setup Virtual Environment
python3 -m venv ./.venv
source .venv/bin/activate

# Install package with specific typer and click versions
pip install typer==${{ matrix.typer-version }} click==${{ matrix.click-version }}
pip install .[dev]

- name: Test CLI Commands
run: |
source .venv/bin/activate

# Test basic CLI help
guardrails --help

# Test validate command help
guardrails validate --help

# Test hub command help
guardrails hub --help

# Test configure command help
guardrails configure --help

# Test hub list command (end-to-end)
guardrails hub list

# Create a simple RAIL spec for testing validate command
cat > test_spec.rail << 'EOF'
<rail version="0.1">
<output>
<string name="answer" description="A simple answer"/>
</output>
<prompt>
Answer the question: What is 2+2?
</prompt>
</rail>
EOF

# Test validate command end-to-end with the RAIL spec
echo '{"answer": "4"}' | guardrails validate test_spec.rail -

# Clean up
rm test_spec.rail
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ dependencies = [
"openai>=1.30.1,<2.0.0",
"rich>=13.6.0,<15.0.0",
"pydantic>=2.0.0, <3.0",
"typer>=0.9.0,<0.16",
"click<8.2.0", # TODO: Upgrade typer range and test cli before allowing >=8.2.0
"typer>=0.9.0,<0.20",
"click>=8.1.0,<8.4.0",
"tenacity>=8.1.0,<10.0.0",
"rstr>=3.2.2,<4.0.0",
"typing-extensions>=4.8.0,<5.0.0",
Expand Down
Loading