Skip to content

Commit 49c2fc1

Browse files
authored
Update Makefile and CI flow (#73)
* Update Makefile Signed-off-by: kerthcet <kerthcet@gmail.com> * Update ci workflow Signed-off-by: kerthcet <kerthcet@gmail.com> * fix test error Signed-off-by: kerthcet <kerthcet@gmail.com> * fix test error Signed-off-by: kerthcet <kerthcet@gmail.com> --------- Signed-off-by: kerthcet <kerthcet@gmail.com>
1 parent 6fb2f32 commit 49c2fc1

5 files changed

Lines changed: 183 additions & 34 deletions

File tree

.github/workflows/python-ci.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ jobs:
1818
with:
1919
python-version: "3.12"
2020

21-
- name: Install Poetry
22-
run: pip install poetry==2.0.0
23-
24-
- name: Configure Poetry
25-
run: poetry config virtualenvs.in-project true
21+
- name: Install uv
22+
run: pip install uv
2623

2724
- name: Install dependencies
28-
run: poetry install --with dev --no-interaction --no-ansi
25+
run: source start.sh
2926

3027
# Lint is already included in `make test`
3128

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
POETRY := poetry
2+
RUFF := .venv/bin/ruff
3+
PYTEST := .venv/bin/pytest
24

35
.PHONY: build
46
build: lint
@@ -19,16 +21,16 @@ down:
1921

2022
.PHONY: lint
2123
lint:
22-
$(POETRY) run ruff check .
24+
$(RUFF) check .
2325

2426
.PHONY: format
2527
format:
26-
$(POETRY) run ruff format .
27-
$(POETRY) run ruff check --fix .
28+
$(RUFF) format .
29+
$(RUFF) check --fix .
2830

2931
.PHONY: test
3032
test: lint
31-
$(POETRY) run pytest tests/unit --timeout=15
33+
$(PYTEST) tests/unit --timeout=15
3234

3335
.PHONY: test-integration
3436
test-integration: lint
@@ -38,7 +40,7 @@ test-integration: lint
3840
trap "docker-compose -f ./docker-compose.yaml down" EXIT; \
3941
until docker exec postgres pg_isready -U alphatr1on; do sleep 1; done; \
4042
until curl -sf http://localhost:11434/api/tags | grep "smollm:135m" > /dev/null; do sleep 1; done; \
41-
$(POETRY) run pytest tests/integration --timeout=30; \
43+
$(PYTEST) tests/integration --timeout=30; \
4244
'
4345
.PHONY: test-all
4446
test-all: test test-integration

pyproject.toml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "alphatrion"
3-
version = "0.0.2"
4-
description = "AlphaTrion is an open-source and all-in-one platform to build AI-powered applications."
3+
version = "0.0.3"
4+
description = "⚒️ AlphaTrion is an open-source framework to help build GenAI applications, including experiment tracking, adaptive model routing, prompt optimization and performance evaluation."
55
license = {text = "Apache-2.0"}
66
readme = "README.md"
7-
requires-python = ">=3.12, <4.0"
7+
requires-python = ">=3.12"
88

99
dependencies = [
1010
"sqlalchemy (>=2.0.43,<3.0.0)",
@@ -17,16 +17,25 @@ dependencies = [
1717
"alembic (>=1.17.1,<2.0.0)",
1818
]
1919

20-
[tool.poetry.group.dev.dependencies]
21-
pytest = ">=8.4.2,<9.0.0"
22-
ruff = "^0.12.12"
23-
pytest-asyncio = ">=0.22.0,<1.0.0"
24-
pytest-timeout = ">=2.1.0,<3.0.0"
25-
faker = "^37.12.0"
20+
[dependency-groups]
21+
dev = [
22+
{include-group = "lint"},
23+
{include-group = "test"}
24+
]
25+
lint = [
26+
"ruff>=0.12",
27+
]
28+
test = [
29+
"pytest>=8.4",
30+
"pytest-asyncio>=0.22",
31+
"pytest-timeout>=2.1",
32+
# Data generation
33+
"faker>=37.12",
34+
]
2635

2736
[build-system]
28-
requires = ["poetry-core>=2.0.0,<3.0.0"]
29-
build-backend = "poetry.core.masonry.api"
37+
requires = ["hatchling"]
38+
build-backend = "hatchling.build"
3039

3140
# Configuration for ruff linter and formatter
3241

start.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
#!/usr/bin/env bash
2-
set -euo pipefail
32

4-
# Activate the uv-managed virtual environment.
5-
# Make sure you've run `uv sync` once before sourcing this script.
6-
if [ ! -d ".venv" ]; then
7-
echo "No .venv directory found. Please run 'uv sync' first to create the virtual environment."
8-
exit 1
9-
fi
10-
11-
# shellcheck source=/dev/null
3+
uv venv
124
source .venv/bin/activate
5+
uv sync

uv.lock

Lines changed: 151 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)