Prepare assignment
Project description
Prepare assignment
Prepare assignment is a GitHub Actions inspired helper tool to prepare assignments at Fontys Venlo. The goal is to define jobs inside the prepare.yml
that indicate how to convert a solution project into a student project.
Dependencies
- Git
- Python >=3.8
Installation
Prepare-assignment is available from PyPI.
# To install:
python3 -m pip install prepare-assignment
# To upgrade
python3 -m pip install --upgrade prepare-assignment
Executing prepare-assignment
To execute a prepare.yml
simply run prepare run
from the same directory.
Command line interface
Use prepare --help
to which commands and flags are available.
Example prepare.yml
First we need to have tasks available that can be executed. Take for example a look at the remove task.
The tests use a testproject, which contains an example of a prepare.yml
, see below for convenience.
name: Test project
jobs:
prepare:
- name: remove out
uses: remove
with:
input:
- "out"
- "out.txt"
force: true
recursive: true
- name: codestripper
id: codestripper
uses: codestripper
with:
include:
- "**/*.java"
- "pom.xml"
working-directory: "solution"
verbosity: 5
- name: Test a run command with substitution
run: echo '${{ tasks.codestripper.outputs.stripped-files }}' > out.txt
For people familiar with GitHub Actions this should look very familiar. We have jobs that indicate what should happen to prepare an assignment. The tasks are defined in their own repositories, if the uses
tag doesn't have a username/organization, it will default to prepare-assignment
. So for example the remove
task uses the following repository: prepare-assignment/remove
Tasks
There are three different kind of tasks available:
- Run tasks: these execute a shell command (for now only bash is supported)
- Python tasks: these execute a python script
- Composite tasks: these combine multiple tasks into one
Custom tasks
It is possible to create custom (python/composite) tasks.
- Create a repository
- Define the properties of the task in
task.yml
, these include- id*: unique identifier
- name*: name of the task
- description*: short description
- runs*: whether it is a python or composite task
- inputs: the inputs for the task
- outputs: the outputs that get set by the task
- Validate that the task definition is correct against the json schema
- If python task, create a script that implements desired functionality
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for prepare_assignment-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff2fd2d99a1842b668ea95601fdce46f220e61b1db1c464fdf6cccfa8af0e673 |
|
MD5 | 7ae20374791bfa00b12b4732641c03c5 |
|
BLAKE2b-256 | b8b60ca897fee92d1f5c6a15cfb48467c0e667b1a31d47b9a851aaf2a4c3f987 |