Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 12 additions & 6 deletions .github/workflows/cat-test-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,32 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Python and Poetry
uses: ./.github/actions/setup-python-poetry
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: "Set up Python"
uses: actions/setup-python@v5
with:
working-directory: .
python-version-file: "pyproject.toml"

- name: Install the project
run: uv sync --all-extras --dev

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: Run Example tests
run: poetry run pytest examples/team_recommender
run: uv run pytest examples/team_recommender/tests/example_4_gate_on_success_threshold/
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

- name: Upload artifacts to Google Drive
if: always()
run: |
zip -r test-output-${{ github.run_number }}.zip examples/team_recommender/tests/test_runs
poetry run python src/cat_ai/publish_to_gdrive.py test-output-${{ github.run_number }}.zip
uv run python src/cat_ai/publish_to_gdrive.py test-output-${{ github.run_number }}.zip
env:
GOOGLE_DRIVE_TEST_OUTPUT_FOLDER_ID: ${{ vars.GOOGLE_DRIVE_TEST_OUTPUT_FOLDER_ID }}

Expand All @@ -49,4 +55,4 @@ jobs:
# if: failure()
# uses: lhotari/action-upterm@v1
# with:
# wait-timeout-minutes: 5
# wait-timeout-minutes: 5
14 changes: 10 additions & 4 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Python and Poetry
uses: ./.github/actions/setup-python-poetry
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: "Set up Python"
uses: actions/setup-python@v5
with:
working-directory: .
python-version-file: "pyproject.toml"

- name: Install the project
run: uv sync --all-extras --dev

- name: Run unit tests
run: poetry run mypy src && poetry run pytest
run: uv run mypy src && uv run pytest
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,24 @@ CAT provides the infrastructure needed to:
## Example Apps

- [team_recommender - Team Recommender](examples/team_recommender/readme.md)
- [pythonCatBot - An OpenAI powered Python console chat app](examples/pythonCatBot/README.md)


## Run Tests

```bash
poetry run pytest
uv run pytest
```

## Code Quality

```bash
poetry run mypy -p src
uv run mypy -p src
```

## [Publishing Documentation](https://thisisartium.github.io/continuous-alignment-testing)

The Sphinx based documentation is available at [https://thisisartium.github.io/continuous-alignment-testing](https://thisisartium.github.io/continuous-alignment-testing)
The Sphinx based documentation is available at [https://thisisartium.github.io/cat-ai](https://thisisartium.github.io/cat-ai)

## [Wiki](wiki)

- [Archive - To see potentially helpful previous iterations of the code](wiki/ARCHIVE.md)
- [Archive - To see potentially helpful previous iterations of the code](wiki)
6 changes: 5 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ title: Getting Started
## Poetry
```sh
poetry install cat-ai

## UV

uv add cat-ai
```

# Driving out non-deterministic projects with CAT

Let's do a step by step journey through the lifecycle of a project to show how and why to use CAT. We will use an example of a project using an LLM and prompt to give recommendations of software teams for a project. The first step will be working with the prompt and LLM in [local development](local-development.md)
Let's do a step by step journey through the lifecycle of a project to show how and why to use CAT. We will use an example of a project using an LLM and prompt to give recommendations of software teams for a project. The first step will be working with the prompt and LLM in [local development](local-development.md)
1 change: 0 additions & 1 deletion examples/team_recommender/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
from dotenv import load_dotenv

# Load environment variables from .env file
Expand Down
6 changes: 3 additions & 3 deletions examples/team_recommender/readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Local Setup
- install [poetry](https://python-poetry.org/docs/#installation)
- run `poetry install`
- install [uv](https://docs.astral.sh/uv/getting-started/installation)
- run `uv sync`
- run `cp .env.example .env`
- populate your new `.env` file

# Running the tests
- run `poetry run pytest`
- run `uv run pytest`
1,713 changes: 0 additions & 1,713 deletions poetry.lock

This file was deleted.

60 changes: 31 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
[tool.poetry]
[project]
name = "cat-ai"
version = "0.0.5-alpha"
description = "Python client for running CAT tests in a Python codebase"
authors = [
"Mike Gehard <[email protected]>",
"Randy Lutcavich <[email protected]>",
"Erik Luetkehans <[email protected]>",
"Paul Zabelin <[email protected]>",
"Tim Kersey <[email protected]>",
{ name = "Mike Gehard", email = "[email protected]" },
{ name = "Randy Lutcavich", email = "[email protected]" },
{ name = "Erik Luetkehans", email = "[email protected]" },
{ name = "Paul Zabelin", email = "[email protected]" },
{ name = "Tim Kersey", email = "[email protected]" },
]
requires-python = "~=3.13"
readme = "README.md"
dependencies = ["pydantic>=2.10.6,<3", "pydrive2>=1.21.3,<2"]
packages = [{ include = "cat_ai", from = "src" }]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.13"
pydantic = "^2.10.6"
pydrive2 = "^1.21.3"

[tool.poetry.group.test.dependencies]
pytest = "^8.3.4"
pytest-asyncio = "^0.21.0"
mypy = "^1.8.0"
black = "^24.2.0"
flake8 = "^7.0.0"

[tool.poetry.group.examples.dependencies]
openai = "^1.63.2"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
sphinx = "^8.1.3"
sphinx-rtd-theme = "^3.0.2"
sphinx-markdown-builder = "^0.6.8"
[dependency-groups]
test = [
"pytest>=8.3.4,<9",
"pytest-asyncio>=0.21.0,<0.22",
"mypy>=1.8.0,<2",
"black>=24.2.0,<25",
]
examples = ["openai>=1.63.2,<2", "python-dotenv>=1.0.1,<2"]
dev = [
"sphinx>=8.1.3,<9",
"sphinx-rtd-theme>=3.0.2,<4",
"sphinx-markdown-builder>=0.6.8,<0.7",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.uv]
default-groups = ["test", "examples", "dev"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
Expand All @@ -63,3 +57,11 @@ mypy_path = ["src"]
line-length = 120
target-version = ['py313']
include = '\.pyi?$'

[tool.ruff]
# Rule selection and configuration
line-length = 120
lint.extend-ignore = ["E203"]
exclude = [".git", "__pycache__", "build", "dist"]
# Equivalent to max-complexity
lint.mccabe = { max-complexity = 10 }
Loading
Loading