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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
40 changes: 19 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,54 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Run validation script
run: |
python scripts/validate-exercise-config.py
uv run python scripts/validate-exercise-config.py

Comment thread
jovnc marked this conversation as resolved.
unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
enable-cache: true
- name: Install dependencies
run: |
pip install -r requirements.txt
uv sync --locked --group test
- name: Set up Git
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git config --global init.defaultBranch main
- name: Run unit tests
run: |
python -m pytest -s -vv
uv run pytest -s -vv

mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
enable-cache: true
- name: Install dependencies
run: |
pip install -r requirements.txt
uv sync --locked --group dev --group test
- name: Set up Git
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git config --global init.defaultBranch main
- name: Run mypy
run: |
python -m mypy .
uv run mypy .

format:
runs-on: ubuntu-latest
Expand All @@ -75,17 +73,17 @@ jobs:
with:
ref: main
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
enable-cache: true
- name: Install dependencies
run: |
pip install -r requirements.txt
uv sync --locked --group dev
- name: Run formatter using ruff
run: |
ruff check --fix
ruff format
uv run ruff check --fix
uv run ruff format
- name: Saving changes
run: |
git config --global user.name "github-actions"
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Generate exercise-directory.md
run: |
python scripts/create-exercise-directory.py
uv run python scripts/create-exercise-directory.py
mv exercise-directory.md index.md
Comment thread
jovnc marked this conversation as resolved.

- name: Deploy to gh-pages
Expand Down
6 changes: 3 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ pre-commit:
commands:
ruff-lint:
glob: "*.py"
run: ruff check --fix {staged_files}
run: uv run ruff check --fix {staged_files}
stage_fixed: true

ruff-format:
glob: "*.py"
run: ruff format {staged_files}
run: uv run ruff format {staged_files}
stage_fixed: true

mypy:
glob: "*.py"
run: mypy .
run: uv run mypy .
4 changes: 2 additions & 2 deletions new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ read choice

case "$choice" in
"hands-on" | "h" | "H")
python scripts/new-hands-on.py
uv run python scripts/new-hands-on.py
;;
"exercise" | "e" | "E")
python scripts/new-exercise.py
uv run python scripts/new-exercise.py
;;
*)
echo "Invalid choice. Please enter 'hands-on' (h) or 'exercise' (e)."
Expand Down
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[project]
name = "cs3281-exercises"
version = "0.1.0"
requires-python = ">=3.13"
dependencies = [
"git-autograder",
"PyYAML",
"PyGithub",
"requests",
"repo-smith"
]

[dependency-groups]
test = ["pytest"]
dev = [
"lefthook",
"ruff",
"mypy",
"types-requests",
]
15 changes: 0 additions & 15 deletions requirements.txt

This file was deleted.

15 changes: 2 additions & 13 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
#!/bin/bash

if [ ! -d venv/ ]; then
python -m venv venv
fi

source venv/bin/activate

pip install -r requirements.txt -U --no-cache-dir

if command -v lefthook >/dev/null 2>&1; then
lefthook install
else
echo "LeftHook not installed, failed to set up LeftHook for Git Hooks."
fi
uv sync --all-groups
Comment thread
jovnc marked this conversation as resolved.
uv run lefthook install
3 changes: 1 addition & 2 deletions test-download.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

# PYTHONPATH tells python to look for modules in the current directory
PYTHONPATH="." python scripts/test-download.py $1
PYTHONPATH=. uv run python scripts/test-download.py "$1"
14 changes: 1 addition & 13 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
#!/bin/bash
set -e

if [ -f "venv/bin/activate" ]; then
# Linux / macOS
source venv/bin/activate
elif [ -f "venv/Scripts/activate" ]; then
# Windows (Git Bash, Cygwin, or WSL)
source venv/Scripts/activate
else
echo "Error: Could not find Python virtual environment activation script."
echo "Please create one with: python -m venv venv"
exit 1
fi

python -m pytest $1/test_verify.py -s -vv
uv run pytest "$1/test_verify.py" -s -vv
Loading
Loading