Skip to content

Commit 6e23129

Browse files
committed
Refactor GitHub workflows to use uv for setup and project installation
- Replaced setup from local action to `astral-sh/setup-uv@v5` and `actions/setup-python@v5`. - Updated Python setup to use `python-version-file: "pyproject.toml"`. - Changed project installation command to `uv sync --all-extras --dev`. - Modified test commands to use `uv run` instead of `poetry run`. - Updated documentation link in README Signed-off-by: Tim Kersey <[email protected]>
1 parent 9c513e2 commit 6e23129

File tree

8 files changed

+1095
-1755
lines changed

8 files changed

+1095
-1755
lines changed

.github/workflows/cat-test-examples.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,32 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
- name: Setup Python and Poetry
19-
uses: ./.github/actions/setup-python-poetry
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
20+
21+
- name: "Set up Python"
22+
uses: actions/setup-python@v5
2023
with:
21-
working-directory: .
24+
python-version-file: "pyproject.toml"
25+
26+
- name: Install the project
27+
run: uv sync --all-extras --dev
2228

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

2834
- name: Run Example tests
29-
run: poetry run pytest examples/team_recommender
35+
run: uv run pytest examples/team_recommender/tests/example_4_gate_on_success_threshold/
3036
env:
3137
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
3238

3339
- name: Upload artifacts to Google Drive
3440
if: always()
3541
run: |
3642
zip -r test-output-${{ github.run_number }}.zip examples/team_recommender/tests/test_runs
37-
poetry run python src/cat_ai/publish_to_gdrive.py test-output-${{ github.run_number }}.zip
43+
uv run python src/cat_ai/publish_to_gdrive.py test-output-${{ github.run_number }}.zip
3844
env:
3945
GOOGLE_DRIVE_TEST_OUTPUT_FOLDER_ID: ${{ vars.GOOGLE_DRIVE_TEST_OUTPUT_FOLDER_ID }}
4046

@@ -49,4 +55,4 @@ jobs:
4955
# if: failure()
5056
# uses: lhotari/action-upterm@v1
5157
# with:
52-
# wait-timeout-minutes: 5
58+
# wait-timeout-minutes: 5

.github/workflows/python-tests.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
- name: Setup Python and Poetry
19-
uses: ./.github/actions/setup-python-poetry
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
20+
21+
- name: "Set up Python"
22+
uses: actions/setup-python@v5
2023
with:
21-
working-directory: .
24+
python-version-file: "pyproject.toml"
25+
26+
- name: Install the project
27+
run: uv sync --all-extras --dev
2228

2329
- name: Run unit tests
24-
run: poetry run mypy src && poetry run pytest
30+
run: uv run mypy src && uv run pytest

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,24 @@ CAT provides the infrastructure needed to:
1414
## Example Apps
1515

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

1918

2019
## Run Tests
2120

2221
```bash
23-
poetry run pytest
22+
uv run pytest
2423
```
2524

2625
## Code Quality
2726

2827
```bash
29-
poetry run mypy -p src
28+
uv run mypy -p src
3029
```
3130

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

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

3635
## [Wiki](wiki)
3736

38-
- [Archive - To see potentially helpful previous iterations of the code](wiki/ARCHIVE.md)
37+
- [Archive - To see potentially helpful previous iterations of the code](wiki)

docs/getting-started.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ title: Getting Started
88
## Poetry
99
```sh
1010
poetry install cat-ai
11+
12+
## UV
13+
14+
uv add cat-ai
1115
```
1216

1317
# Driving out non-deterministic projects with CAT
1418

15-
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)
19+
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)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Local Setup
2-
- install [poetry](https://python-poetry.org/docs/#installation)
3-
- run `poetry install`
2+
- install [uv](https://docs.astral.sh/uv/getting-started/installation)
3+
- run `uv sync`
44
- run `cp .env.example .env`
55
- populate your new `.env` file
66

77
# Running the tests
8-
- run `poetry run pytest`
8+
- run `uv run pytest`

poetry.lock

Lines changed: 0 additions & 1713 deletions
This file was deleted.

pyproject.toml

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,55 @@
1-
[tool.poetry]
1+
[project]
22
name = "cat-ai"
33
version = "0.0.5-alpha"
44
description = "Python client for running CAT tests in a Python codebase"
55
authors = [
6-
"Mike Gehard <[email protected]>",
7-
"Randy Lutcavich <[email protected]>",
6+
{ name = "Mike Gehard", email = "[email protected]" },
7+
{ name = "Randy Lutcavich", email = "[email protected]" },
88
]
9+
requires-python = "~=3.13"
910
readme = "README.md"
10-
packages = [{ include = "cat_ai", from = "src" }]
11+
dependencies = [
12+
"pydantic>=2.10.6,<3",
13+
"pydrive2>=1.21.3,<2",
14+
]
15+
16+
[dependency-groups]
17+
test = [
18+
"pytest>=8.3.4,<9",
19+
"pytest-asyncio>=0.21.0,<0.22",
20+
"mypy>=1.8.0,<2",
21+
"black>=24.2.0,<25",
22+
"flake8>=7.0.0,<8",
23+
]
24+
examples = [
25+
"openai>=1.63.2,<2",
26+
"python-dotenv>=1.0.1,<2",
27+
]
28+
dev = [
29+
"sphinx>=8.1.3,<9",
30+
"sphinx-rtd-theme>=3.0.2,<4",
31+
"sphinx-markdown-builder>=0.6.8,<0.7",
32+
]
1133

12-
[tool.poetry.dependencies]
13-
python = "^3.13"
14-
pydantic = "^2.10.6"
15-
pydrive2 = "^1.21.3"
34+
[tool.uv]
35+
default-groups = [
36+
"test",
37+
"examples",
38+
"dev",
39+
]
1640

17-
[tool.poetry.group.test.dependencies]
18-
pytest = "^8.3.4"
19-
pytest-asyncio = "^0.21.0"
20-
mypy = "^1.8.0"
21-
black = "^24.2.0"
22-
flake8 = "^7.0.0"
41+
[tool.hatch.build.targets.sdist]
42+
include = ["src/cat_ai"]
2343

24-
[tool.poetry.group.examples.dependencies]
25-
openai = "^1.63.2"
26-
python-dotenv = "^1.0.1"
44+
[tool.hatch.build.targets.wheel]
45+
include = ["src/cat_ai"]
2746

28-
[tool.poetry.group.dev.dependencies]
29-
sphinx = "^8.1.3"
30-
sphinx-rtd-theme = "^3.0.2"
31-
sphinx-markdown-builder = "^0.6.8"
47+
[tool.hatch.build.targets.wheel.sources]
48+
"src/cat_ai" = "cat_ai"
3249

3350
[build-system]
34-
requires = ["poetry-core"]
35-
build-backend = "poetry.core.masonry.api"
51+
requires = ["hatchling"]
52+
build-backend = "hatchling.build"
3653

3754
[tool.pytest.ini_options]
3855
asyncio_mode = "auto"

0 commit comments

Comments
 (0)