We use uv to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
$ uv sync --all-extrasYou can then run scripts using uv run python script.py or by activating the virtual environment:
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate
# now you can omit the `uv run` prefix
$ python script.pyAlternatively if you don't want to install uv, you can stick with the standard pip setup by ensuring you have the Python version specified in .python-version, create a virtual environment however you desire and then install dependencies using this command:
$ pip install -e ".[dev]"The SDK code in src/giskard_hub/ can be freely modified. The src/giskard_hub/lib/ and examples/ directories are for custom code and examples.
All files in the examples/ directory can be freely edited or added to.
# add an example to examples/<your-example>.py
#!/usr/bin/env -S uv run python
…$ chmod +x examples/<your-example>.py
# run the example against your api
$ ./examples/<your-example>.pyIf you’d like to use the repository from source, you can either install from git or link to a cloned repository:
To install via git:
$ pip install git+https://github.com/Giskard-AI/giskard-hub-python.gitAlternatively, you can build from source and install the wheel file:
Building this package will create two files in the dist/ directory, a .tar.gz containing the source files and a .whl that can be used to install the package efficiently.
To create a distributable version of the library, all you have to do is run this command:
$ uv build
# or
$ python -m buildThen to install:
$ pip install ./path-to-wheel-file.whl$ uv run pytestThis repository uses ruff to format and lint the code in the repository.
To lint:
$ uv run ruff check .
uv run pyright
uv run mypy .
uv run python -c 'import giskard_hub'To format and fix all ruff issues automatically:
$ uv run ruff formatIf you need to manually release a package, you can run the bin/publish-pypi script with a PYPI_TOKEN set on
the environment.