Skip to main content

Build cli zipapp

CHKware zipapp is a self contained executable alike utility that once build can be used from anywhere. However, it have python version dependency.

Follow these steps to bundle chkware as zipapp.

  • Please confirm that Python 3.11.x is installed and setup on this machine

  • Clone the repo

    git clone https://github.com/chkware/cli.git cli-zip
  • Change to the directory

    cd cli-zip
  • Make directory for local virtualenv setup

    python -m venv .venv
  • Switch to the virtualenv

    source .venv/bin/activate

    or on windows

    .venv/Scripts/activate.bat
  • Install all required packages

    pip install -U -r requirements.txt
  • Install shiv for building the zipapp

    pip install -U shiv
  • Use the environment's python to build the zipapp. Refer to shiv documentation for further explanation.

    python -m shiv -c chk -o chk.pyz .
  • chk.pyz is generated in the project folder. You can move it to anywhere on your machine, and put it on your machine's environment variable or $PATH. Then, use it as follows:

    chk.pyz http tests/resources/storage/sample_config/xkcd-joke.chk