Skip to main content

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

Config file

It is possible to specify global options in a config file. The location of the config file can be found by running prepare without any commands.

The following settings are available:

core:
  git-mode: "ssh|https"
  verbose: int
  debug: int

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
  4. 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

prepare_assignment-0.3.0.tar.gz (115.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prepare_assignment-0.3.0-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file prepare_assignment-0.3.0.tar.gz.

File metadata

  • Download URL: prepare_assignment-0.3.0.tar.gz
  • Upload date:
  • Size: 115.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for prepare_assignment-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7a1aee8cccf6f520128bc9c42b2cb3f7624263f1f27b7764947c79f06d3d42d6
MD5 bdbb1ca559089473e2d94b8512e2cf0e
BLAKE2b-256 7f2794318c91e32005d7796106402262946bfda01047cee550eb70aec6eac958

See more details on using hashes here.

File details

Details for the file prepare_assignment-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: prepare_assignment-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for prepare_assignment-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49d1a52f612e96b4743d599c5ce561ccebf9c26302e7c81221495d6f9cf116bf
MD5 cb044cb0e27f170af8a38f2caf2be738
BLAKE2b-256 3ce070d970b341a29379f318280e834f91810f10b138b1d2beb912752179b8a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page