Metadata-Version: 2.1
Name: prepare-assignment
Version: 0.1.1
Summary: Prepare assignment
License: MIT
Author: Bonajo
Author-email: m.bonajo@fontys.nl
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: gitpython (>=3.1.31,<4.0.0)
Requires-Dist: importlib-resources (>=5.12.0,<6.0.0)
Requires-Dist: jsonschema (>=4.17.3,<5.0.0)
Requires-Dist: multipledispatch (>=1.0.0,<2.0.0)
Requires-Dist: prepare-toolbox (==0.3.0)
Requires-Dist: ruamel-yaml (>=0.17.21,<0.18.0)
Requires-Dist: treelib (>=1.7.0,<2.0.0)
Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
Requires-Dist: virtualenv (>=20.24.5,<21.0.0)
Description-Content-Type: text/markdown

# 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

## Example

First we need to have tasks available that can be executed. Take for example a look at the [remove](https://github.com/prepare-assignment/remove) task.

The tests use a [testproject](https://github.com/prepare-assignment/core/tree/tests/testproject), which contains an example of a `prepare.yml`, see below for convenience.

```yaml
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](https://github.com/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.

1. Create a repository
2. 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
3. Validate that the task definition is correct against the [json schema](https://github.com/prepare-assignment/core/blob/main/prepare_assignment/schemas/task.schema.json)
4. If python task, create a script that implements desired functionality


