Skip to content

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

zincon

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"

Features

  • Extract a skeleton zip and initialize a working directory.
  • Create a submission ZIP in one command.
  • Run all test cases and show diff locally.

Installation

New to GitHub? Here are easier step-by-step installation guides
  1. Download and extract the latest ZIP file of this repository
  2. Open a terminal/powershell at the extracted directory
  3. cd "path/to/extracted/directory" if you are in the wrong folder
  4. run pip install .
  5. 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.

Requirements

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.

Required packages

  • click

Install dependencies:

pip install click

Tested on Python 3.13.7.

Example

zincon init <skeleton_path_or_url>

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 lab3

If 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

zincon pack <path>

Pack a submission (uses .zincon-submit file if present):

zincon pack lab3

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

zincon test <path> <entrypoint> [<testcases_dir>]

Run testcases on current progress.

zincon test lab3 <lab3_entrypoint>.py

Specify testcase filename formats by --ifmt and --ofmt. Defaults to input{}.txt and output{}.txt.
Override default timeout of 30s using --timeout.

zincon browse [docs|zinc] [<comp_code>] [<resource>]

Browse lab materials or open zinc

zincon browse docs 1023 pa1
zincon browse zinc

Currently, 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

Contributing

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.

About

Control all your programming files for zinc, programmatically

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages