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
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
name: Lint (Python 3.13)
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.24"
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
enable-cache: true

- name: Install dependencies
run: uv sync --locked --all-groups

- name: isort
run: uv run isort --check-only --diff src tests

- name: pylint
run: uv run pylint src/update_dsa_sheet tests

- name: Minimize uv cache
run: uv cache prune --ci

test:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.24"
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install dependencies
run: uv sync --locked --all-groups

- name: Run tests with coverage
run: uv run coverage run -m pytest

- name: Coverage summary
run: uv run coverage report -m

- name: Generate coverage XML + JSON + HTML
run: |
uv run coverage xml
uv run coverage json
uv run coverage html

- name: Upload coverage artifacts (only once)
if: matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
coverage.xml
coverage.json
htmlcov/
.coverage

- name: Minimize uv cache
run: uv cache prune --ci
33 changes: 0 additions & 33 deletions .github/workflows/python.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
coverage.json
*.cover
*.py,cover
.hypothesis/
Expand Down
78 changes: 78 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "update-dsa-sheet: CLI (file arg)",
"type": "debugpy",
"request": "launch",
"module": "update_dsa_sheet",
"args": [
"${file}"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "update-dsa-sheet: CLI (prompt for file)",
"type": "debugpy",
"request": "launch",
"module": "update_dsa_sheet",
"args": [
"${input:characterSheetPath}"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "pytest: all tests",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"-q"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "pytest: current test file",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"${file}",
"-q"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "pytest: test by name",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"${file}",
"-q",
"-k",
"${input:pytestK}"
],
"console": "integratedTerminal",
"justMyCode": true
}
],
"inputs": [
{
"id": "characterSheetPath",
"type": "promptString",
"description": "Path to character_sheet.html",
"default": "tests/resources/character_sheet.html"
},
{
"id": "pytestK",
"type": "promptString",
"description": "pytest -k expression",
"default": ""
}
]
}
13 changes: 10 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
"python.terminal.activateEnvironment": true,
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestArgs": [
"update_dsa_sheet/test"
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.cwd": "${workspaceFolder}",
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"python.analysis.extraPaths": [
"src"
]
}
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "uv: sync",
"type": "shell",
"command": "uv",
"args": [
"sync",
"--all-groups"
],
"problemMatcher": [],
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
11 changes: 0 additions & 11 deletions Pipfile

This file was deleted.

20 changes: 0 additions & 20 deletions Pipfile.lock

This file was deleted.

Loading