A tool that controls all your zinc files, inspired by COMP1023 Labs.
Testing currently works for Python lab/PAs only. You may modify testing scripts in _run_test_case() to match your need.
I heard that ZINC stands for ZINC is not CASS, so I guess Zincon stands for ZINC is now CONTROLLED
Btw, it's pronounced as "zinc-con", similar to the abbreviation "sing con"
- Extract a skeleton zip and initialize a working directory.
- Create a submission ZIP in one command.
- Run all test cases and show diff locally.
New to GitHub? Here are easier step-by-step installation guides
- Download and extract the latest ZIP file of this repository
- Open a terminal/powershell at the extracted directory
cd "path/to/extracted/directory"if you are in the wrong folder- run
pip install . - try to run
zincon --help. You should be seeing the zincon command usage
You may install zincon by cloning this repository, then running the following commands, preferably under a virtual environment:
cd path\to\zincon
pip install -e .Then you may run zincon directly in your environment.
If you wish to use zincon without installing, replace zincon with python path\to\zincon.py in your commands.
If you do not wish to install zincon directly, you will need to install the requirements manually.
If you have successfully installed zincon using pip install -e ., you can skip this part.
- click
pip install clickTested on Python 3.13.7.
Initialize a skeleton from a zip:
# Download directly
zincon init https://course.cse.ust.hk/.../path/to/labX_skeleton.zip
# Or, use a local ZIP file
zincon init path\to\skeleton.zip --out lab3If the skeleton zip contains lab\d+ in its filename, you may omit --out and the tool will use the matched lab\d+ as the output directory.
Example output structure:
lab0
│ .zincon-submit
│ lab0_skeleton.py
├─backup
│ │ lab0_skeleton.py
│ └─testcases
│ input01.txt
│ output01.txt
└─testcases
input01.txt
output01.txt
Pack a submission (uses .zincon-submit file if present):
zincon pack lab3You may also specify the output directory with the option --out, relative to the working directory. Otherwise, the tool will create a submission.zip under the working directory.
Run testcases on current progress.
zincon test lab3 <lab3_entrypoint>.pySpecify testcase filename formats by --ifmt and --ofmt. Defaults to input{}.txt and output{}.txt.
Override default timeout of 30s using --timeout.
Browse lab materials or open zinc
zincon browse docs 1023 pa1
zincon browse zincCurrently, docs url are defined as follow:
- PAs:
course.cse.ust.hk/comp{comp_code}/assignments/{resource}/#description - Labs:
course.cse.ust.hk/comp{comp_code}/labs/{resource}/#labwork
Contribution is welcome. However, please note that the original intention of this tool is to improve my own zinc workflow, so the tool is customized to my own needs. Please open an issue or PR with a clear description if applicable.