GatorGrade is a Python tool that automates the assessment of student assignments by running configurable checks. It supports both GatorGrader checks and custom shell commands. GatorGrade produces rich output showing pass/fail status and can generate reports in JSON or Markdown format, including integration with GitHub Actions. This tool is the newer Python-based version of GatorGradle.
GatorGrade requires Python 3.10 or later. You can install GatorGrade using any of the following methods:
To run GatorGrade without installing it globally, use uvx:
uvx gatorgradeThis will download and run the latest version of GatorGrade from PyPI.
Alternatively, you can use pipx to install GatorGrade globally:
pipx install gatorgradeThis will then allow you to run the gatorgrade command from anywhere.
To install GatorGrade from source in editable mode:
uv pip install -e .This links the gatorgrade command to your local source code, allowing
you to test changes immediately.
If the repository contains a uv.lock file, you can install all
dependencies and the package:
uv syncThen activate the virtual environment to use gatorgrade.
To use GatorGrade to run checks for an assignment, the assignment must
contain a gatorgrade.yml file that defines the checks to run. For more
information on configuring this file, see the Configuring
Checks section below.
To run GatorGrade checks, execute the gatorgrade command within the
assignment directory:
gatorgradeThis will display the passing (✓) or failing (✕) status of each check along with the overall percentage of passing checks.
--config,-c: Specify a custom configuration file (default:gatorgrade.yml)--report,-r: Generate a report in the formatdestination:format:name(e.g.,file:json:report.jsonorenv:md:GITHUB_STEP_SUMMARY)--status-bar,--no-status-bar: Enable or disable the progress bar
Running set up commands...
Finished!
✔ Complete all TODOs
✔ Call the say_hello function
✘ Write at least 25 words in writing/reflection.md
-~- FAILURES -~-
✘ Write at least 25 words in writing/reflection.md
→ Found 3 word(s) in total of file reflection.md
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Passed 5/7 (71%) of checks for assignment-name! ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛Checks are defined in a gatorgrade.yml file. Each check can be either a
GatorGrader check or a shell command check. Checks can run within a file
context (specific file) or in the global context (entire assignment).
GatorGrader checks verify specific aspects of student work:
- description: Complete all TODOs
check: MatchFileFragment
options:
fragment: TODO
count: 0Shell command checks run arbitrary shell commands:
- description: Run pylint
command: pylint src/*.py --disable=all --enable=EChecks can target specific files by nesting them under a file path:
- src:
- hello_world.py:
- description: Complete all TODOs
check: MatchFileFragment
options:
fragment: TODO
count: 0You can include setup commands that run before checks:
setup: |
pip install -r requirements.txt
echo "Setup complete"
- description: Run tests
command: pytestGenerate reports in JSON or Markdown format. Here is one example that illustrates a command to output a Markdown report to GitHub Actions job summary:
# Output to GitHub Actions job summary
gatorgrade --report env md GITHUB_STEP_SUMMARYTo use GatorGrade to run GatorGrader checks for an assignment, the assignment
must contain a gatorgrade.yml file that defines the GatorGrader checks.
Instructors, for more information on configuring the gatorgrade.yml file, see
the Configuring GatorGrader Checks section
below. The following is the output of running GatorGrade on the GatorGrade
Hello World
assignment.
Running set up commands...
Finished!
✔ Complete all TODOs
✔ Call the say_hello function
✔ Call the say_hello_color function
✘ Complete all TODOs
✘ Write at least 25 words in writing/reflection.md
✔ Pass pylint
✔ Have a total of 5 commits, 2 of which were created by you
-~- FAILURES -~-
✘ Complete all TODOs
→ Found 3 fragment(s) in the reflection.md or the output
✘ Write at least 25 words in writing/reflection.md
→ Found 3 word(s) in total of file reflection.md
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Passed 5/7 (71%) of checks for gatorgrade-hello-world! ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛Instructors can configure checks for an assignment by creating a
gatorgrade.yml file. The file supports two types of checks:
GatorGrader checks (e.g., MatchFileFragment, CountCommits) and shell
command checks.
To configure checks that run within a file context (i.e., for a specific file), specify the path to the file as a key (or nested keys) before specifying the checks:
- src:
- hello_world.py:
- description: Complete all TODOs
check: MatchFileFragment
options:
fragment: TODO
count: 0
- description: Define a print statement
check: MatchFileFragment
options:
fragment: print(
count: 1To configure checks that run in the global context (i.e., for the
assignment in general), specify the checks at the top level of the
gatorgrade.yml file:
- description: Have a total of 8 commits, 5 of which were created by you
check: CountCommits
options:
count: 8To configure a shell command check, use the command key instead of
check:
- description: Run pylint
command: pylint src/*.py --disable=all --enable=ERun all tests with verbose output:
uv run task testRun tests without output:
uv run task test-silentRun tests with coverage tracking:
uv run task test-coverageRun tests without property-based tests:
uv run task test-not-propertyRun tests without order randomization:
uv run task test-not-randomRun all linting checks:
uv run task lintCheck code formatting:
uv run task formatFix code formatting:
uv run task format-fixRun ruff linting checks:
uv run task ruff-checkRun all type checkers:
uv run task typecheckRun the mypy type checker:
uv run task mypyRun the ty type checker:
uv run task tyRun the pyrefly type checker:
uv run task pyreflyRun symbex checks for typed and documented functions:
uv run task symbexRun all linting and testing commands:
uv run task allFor preliminary information about mutation testing with GatorGrade, including manual workflows, helper scripts, and specifications for automated mutation testing agents, please see the MUTATION.md file.
If you would like to contribute to GatorGrade, please refer to the GatorGrade Wiki for contributing guidelines.