Skip to content

Commit 18f71e1

Browse files
authored
Added uv setup (#38)
1 parent 5050d86 commit 18f71e1

File tree

5 files changed

+2803
-27
lines changed

5 files changed

+2803
-27
lines changed

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish markus-ai-feedback package to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
run:
9+
name: Publish package
10+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
permissions:
15+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@v6
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v7
21+
with:
22+
enable-cache: true
23+
- name: Install Python
24+
run: uv python install
25+
- name: Build the package
26+
run: uv build
27+
- name: Publish
28+
run: uv publish

.github/workflows/test.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,21 @@ jobs:
1515
python-version: ["3.13"]
1616

1717
steps:
18-
- uses: actions/checkout@v4.2.2
18+
- uses: actions/checkout@v6
1919
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5.3.0
20+
uses: actions/setup-python@v6
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
- name: Cache pip
24-
uses: actions/[email protected]
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v7
2525
with:
26-
path: ~/.cache/pip
27-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
28-
restore-keys: |
29-
${{ runner.os }}-pip-
30-
${{ runner.os }}-
31-
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip setuptools wheel
34-
pip install -e .[dev]
26+
enable-cache: true
27+
- name: Install the project
28+
run: uv sync --locked --all-extras --dev
3529
- name: Run tests
3630
env:
3731
LLAMA_MODEL_PATH: /fake/path/to/model.gguf
3832
LLAMA_CLI_PATH: /fake/path/to/llama-cli
3933
LLAMA_SERVER_URL: http://localhost:8080
4034
OPENAI_API_KEY: fake-api-key
41-
run: |
42-
pytest -vv || [ $? -eq 5 ]
35+
run: uv run pytest -vv || [ $? -eq 5 ]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

pyproject.toml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
[project]
2-
name = "ai_feedback"
2+
name = "markus-ai-feedback"
33
version = "0.0.1"
44
authors = [
55
{ name="Ricky Chen" },
66
{ name="Sohee Goo" },
7+
{ name="Rolland He" },
8+
{ name="Mateo Naranjo" },
9+
{ name="Will Kukkamalla" },
10+
{ name="Nathan Taback" },
11+
{ name="Donny Wong" },
712
]
813
maintainers = [
914
{ name="David Liu", email="[email protected]" },
10-
{ name="Nathan Taback" },
1115
]
1216
description = "A package for generating AI feedback on student work"
1317
readme = "README.md"
14-
requires-python = ">=3.8"
18+
requires-python = ">=3.9"
1519
classifiers = [
1620
"Programming Language :: Python :: 3",
1721
"Operating System :: OS Independent",
@@ -31,7 +35,7 @@ dependencies = [
3135
"requests",
3236
]
3337

34-
[project.optional-dependencies]
38+
[dependency-groups]
3539
dev = [
3640
"pre-commit",
3741
"pytest",
@@ -45,18 +49,17 @@ Homepage = "https://github.com/MarkUsProject/ai-autograding-feedback/"
4549
Issues = "https://github.com/MarkUsProject/ai-autograding-feedback/issues"
4650

4751
[build-system]
48-
requires = ["hatchling >= 1.26"]
49-
build-backend = "hatchling.build"
52+
requires = ["uv_build>=0.9.21,<0.10.0"]
53+
build-backend = "uv_build"
54+
55+
[tool.uv.build-backend]
56+
data = { data = "ai_feedback/data" }
57+
module-name = "ai_feedback"
58+
module-root = ""
5059

5160
[tool.black]
5261
line-length = 120
5362
skip-string-normalization = true
5463

55-
[tool.hatch.build]
56-
include = [
57-
"/ai_feedback/**/*.py",
58-
"/ai_feedback/data",
59-
]
60-
6164
[tool.isort]
6265
profile = "black"

0 commit comments

Comments
 (0)