Skip to main content

Console tool developer setup

Local development environment setup for CHKware cli tool

Make sure you are doing following to develop chk cli tool in your machine.

Prerequisite:

Development setup

  • Fork the https://github.com/chkware/cli repository

  • Clone the repository

    git clone [email protected]:chkware/cli.git chkware-cli
  • Create virtual environment and setup project

    poetry install --with test

That's all needed for development setup.

Development IDE setup

You should setup your IDE with Ruff and Mypy.

Run tests

We use PyTest as testing library. So, get your basic of understanding in it. We also use

Running specific test

poetry run py.test -s tests/[FILE]::[TEST_CLASS]::[TEST_FUNC]

Running chk while development

poetry run python -m chk [SUB_COMMAND] [OPTIONS] [SPEC_FILE]

Common development tasks

Analyze linting and formatting issues

warning

Do this before doing merge request.

Run following to analyze linting and formatting issues.

poetry poe fix

Build package

Run following to build packages to be uploaded to PyPI.

poetry build
note

Make sure to install the local package with pipx before PyPI release.

Clear test run cache

Run following to clear test run cache.

poetry poe clear-cache

Create requirements for CI/CD

Run following to create requirements for CI/CD.

poetry poe requirements

Build shiv zipapp

warning

This was tested in macOS only. Although, it's expected to work in any environment.

CHKware zipapp is a self contained executable like packaging of the software, that once build can be used from anywhere.

Follow these steps to bundle chkware as zipapp.

poetry poe build-shiv