Skip to main content

TMC course and assignment creation helper

Reason this release was yanked:

Incorrect minimum python version metadata

Project description

TMC Course creation helper

linuxwindows

tmc-course helps with managing (python-based) TestMyCode courses by allowing you to initialize, update and test them.

Installing

pip install tmc-course

Usage

usage: tmc-course [-h] [--version] [--quiet | --debug] ACTION ...

Helper for building TestMyCode python programming courses

positional arguments:
  ACTION
    init       Initialize a new course, part or assignment
    test       Test a new course, part or assignment
    update     Update TMC-python-runner embedded in assignments

options:
  -h, --help   show this help message and exit
  --version    show program's version number and exit
  --quiet, -q  Only output warning
  --debug, -d  Output debugging information

tmc-course init - Initialize new courses, parts and assignments

Run the init command to initialize a new course, part of assignment from a project skeleton that contains the files required by TMC to function correctly.

Initialize new course

usage: tmc-course init course [-h] path [path ...]

positional arguments:
  path        Path(s) of the new course(s)

options:
  -h, --help  show this help message and exit

Initialize new part

Parts are collections of assignments

usage: tmc-course init part [-h] path [path ...]

positional arguments:
  path        Path(s) of the new part(s)

options:
  -h, --help  show this help message and exit

Initialize new assignment

Assignments are initialized in either English (-e) or Finnish (-f). The freshly initialized assignments are built with a skeleton structure which showcases the use of tests and points, and contains the additional files required by TMC.

usage: tmc-course init assignment [-h] (-e | -f) path [path ...]

positional arguments:
  path           Path(s) of the new assignment(s)

options:
  -h, --help     show this help message and exit
  -e, --english  Use English language templates
  -f, --finnish  Use Finnish language templates

tmc-course update Update TMC files

The update command updates the files required by TMC for all assignments

usage: tmc-course update [-h] path

positional arguments:
  path        Course root directory

options:
  -h, --help  show this help message and exit

tmc-course test Run tests for the course

Use the test command to run the tests for a course, part or assignment the same way the TMC server would run them. This verifies your model solutions pass the tests.

usage: tmc-course test [-h] [--details] path [path ...]

positional arguments:
  path        Path(s) to test (course, part or assignment)

options:
  -h, --help  show this help message and exit
  --details   Show more details about test results

By default, detailed information is only shown about assignments that fail their tests. Use --details to show additional help.

As a pre-commit hook

tmc-course can be used as a pre-commit hook. When set up correctly, tmc-course test is ran for the repository on commit.

To use tmc-course as a pre-commit hook, add the the following config:

  - repo: https://github.com/ljleppan/tmc-course
    rev: 1.0.0b2
    hooks:
      - id: tmc-course

Development

Installing

pip install .[dev]
pre-commit install

Pre-commit hooks

The repo comes set up for a combination of mypy, black, flake8 and isort. These are all set up as pre-commit hooks. Assuming you run pre-commit install as shown above, these will automatically run whenever you attempt to commit code into git. I suggest running mypy using --strict.

Tox and tests

Run tox to manually run all pre-commit hooks and tests. Tests fail if test coverage goes below 80 %.

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

tmc-course-1.0.0b2.tar.gz (140.7 kB view details)

Uploaded Source

Built Distribution

tmc_course-1.0.0b2-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file tmc-course-1.0.0b2.tar.gz.

File metadata

  • Download URL: tmc-course-1.0.0b2.tar.gz
  • Upload date:
  • Size: 140.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for tmc-course-1.0.0b2.tar.gz
Algorithm Hash digest
SHA256 57fea4c3ff9891b91074d302792f9bd0bca3893de39422f31e3a670400601ede
MD5 da65268fa43d1ba7aea59b676e2eb21e
BLAKE2b-256 27247f4997b80fc5c57a81f1b56ffcd81d4040b3d720cfdcd4ddfbae2738ad2f

See more details on using hashes here.

File details

Details for the file tmc_course-1.0.0b2-py3-none-any.whl.

File metadata

  • Download URL: tmc_course-1.0.0b2-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for tmc_course-1.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 5797b11221413e6f46a410e9698205cdfff2922c7934d559c3b5957abc080040
MD5 9cdab2748d2eca35ee8dbaa46ec105cb
BLAKE2b-256 d55c406f7e04cfd72b142436e19dd3e2c4343fdda01d24155822166f9587d3a1

See more details on using hashes here.

Supported by

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