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:
-
Install Python 3.13.x
-
Install Poetry
-
Install Poetry dotenv plugin.
poetry self add poetry-dotenv-plugin
-
Install Poetry 'Poe the Poet' plugin. Also get a good understanding on it.
poetry self add 'poethepoet[poetry_plugin]'
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
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
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
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