/grade-python

Docker: Python grading environment

Primary LanguageShellMIT LicenseMIT

Grading environment with specific Python version in path.

Includes following extra packages:

Tags

Images are tagged with Python and grading-base versions in format <python>-<grading-base>. Version tag can also include uN meaning update N where N is an increasing number. The update part is used to indicate updates to the image, where software versions did not change. For an example, 3.5-2.0u1 includes Python 3.5 on top of grading-base 2.0 and has one update after first release.

There is also few additional versions of the image:

  • math-* includes python packages matplotlib, scipy and numpy on top of base
  • bokeh-* includes python package bokeh on top of base

Utility commands

In addition to grading-base, this container provides following utilities.

  • graderutils [arguments]

    Executes graderutils.main python module using capture wrapper (check grading-base). Provided arguments are passed to the python module. If there is no arguments, then the module is executed with /exercise/test_config.yaml is the first argument. In other words, if you define graderutils configuration in test_config.yaml, you only need to have graderutils in config.yaml cmd field.

  • unittest

    Alias for python3 -m unittest. Adds /exercise to PYTHONPATH.

  • unittest-capture

    Wrapper around capture and unittest python module. Adds /exercise to PYTHONPATH. Does execute err-to-out if there is no errors.

  • unittest-testcase [-t title] [-p points] [-s skip] [unittest arguments]

    Wrapper around testcase and unittest python module. Adds /exercise to PYTHONPATH. Arguments are passed to testcase and unittest arguments for the python module. Check testcase documentation in grading-base.

  • python-compile-all

    Alias for python3 -m compileall. Use it to validate python syntax of input files before tests.

  • run-all-unittests [-S] [-p points_per_test_class]

    Command to do it all. Can replace run.sh in trivial cases.

    First, script validates syntax, unless -S is provided. If syntax is not valid, no tests are run. Second, script finds all files matching *test*.py pattern from submission and exercise paths. Then, it runs every class that directly inherits unittest.TestCase using testcase and unittest. Testcase will give points_per_test_class many points per successful execution of unittest.