diff --git a/.github/workflows/python-ci.yaml b/.github/workflows/python-ci.yaml index a3d3d5f..c7f58ef 100644 --- a/.github/workflows/python-ci.yaml +++ b/.github/workflows/python-ci.yaml @@ -29,9 +29,8 @@ jobs: run: | cd python_cli python -m pip install --upgrade pip - pip install .[test] - pip install black flake8 - + pip install .[test,dev] + - name: Run black run: | cd python_cli diff --git a/python_cli/README.md b/python_cli/README.md index 22917b7..2ae30c5 100644 --- a/python_cli/README.md +++ b/python_cli/README.md @@ -9,13 +9,6 @@ pip install liquidai-cli A `docker-compose.yaml` file is also shipped together with the package. Any changes to this file may cause some unexpected behaviors. -### Run with `uv` -`uv` allows to run this tool without installing the package into the system. - -```bash -uv run --directory [PATH_TO_THIS_DIRECTORY] liquidai [command] [args] -``` - ## Configuration The CLI uses a YAML configuration file (`liquid.yaml`) in your working directory. A default configuration will be created on first use, but you can customize it: @@ -34,6 +27,70 @@ database: schema: "labs" ``` +## Local Development + +### Setting Up the Development Environment + +To set up a local development environment for the Liquid Labs CLI: + +```bash +git clone https://github.com/Liquid4All/on-prem-stack.git +cd on-prem-stack/python_cli + +# Install the package in development mode with test and development dependencies +pip install -e ".[test,dev]" +``` + +### Running the CLI Locally + +There are several ways to run the CLI locally: + +- Using Python module (recommended for development): +```bash +python -m liquidai_cli.cli [command] [args] +``` + +- Using `uv` without installing the package: +```bash +uv run --directory . -m liquidai_cli.cli [command] [args] +``` + +- Install the package in development mode with test dependencies +```bash +pip install -e ".[test,dev]" +liquid-cli [command] [args] +``` + +### Running Tests + +To run tests for the Liquid Labs CLI: + +```bash +# Run all tests with verbose output +pytest -v + +# Run tests with coverage reporting +pytest --cov=liquidai_cli + +# Run tests with coverage reporting and generate XML report (used in CI) +pytest --cov=liquidai_cli --cov-report=xml +``` + +### Code Quality Checks + +Before submitting changes, make sure to run the following code quality checks: + +```bash +# Check code formatting with black +black . --check + +# Run linting with flake8 +flake8 . + +# You can also format your code automatically with black +black . +``` + ## Usage ### Stack Management diff --git a/python_cli/pyproject.toml b/python_cli/pyproject.toml index 47fa0eb..5e8d9e2 100644 --- a/python_cli/pyproject.toml +++ b/python_cli/pyproject.toml @@ -44,3 +44,7 @@ test = [ "pytest-cov>=4.0.0", "pytest-mock>=3.10.0", ] +dev = [ + "black>=23.0.0", + "flake8>=6.0.0", +]