-
Notifications
You must be signed in to change notification settings - Fork 18
Setup Feluda Locally for Development
With the release of Feluda v0.0.9, it is now available as a Python package, and some operators have been separated into standalone Python packages. This update simplifies Feluda's use for developers and researchers. This documentation provides instructions on setting up Feluda for contributing to the python packages.
Important
If you are looking to setup an older version of Feluda i.e. v0.0.8
and before, follow this page for the detailed documentation.
- Python and Git
- Ensure
uv
is installed - download uv by following its official installation documentation. Feluda usesuv
to manage and develop the python packages. (more information on uv)
First step is to clone the repo. You can also fork and clone the repo
git clone https://github.com/tattle-made/feluda.git
cd feluda/
- Create a virtual environment
uv
recommendeds that all python packages be installed in a virtual environment. Generally, it is considered a good practice not to modify a Python system installation's environment.
uv venv
source .venv/bin/activate
- Install
feluda
and otherdev
dependencies
# install core feluda dependencies
uv pip install .
# install dev dependencies
uv pip install ".[dev]"
- Install
pre-commit
hooks
pre-commit install
pre-commit install --hook-type commit-msg
This sets up the feluda package, making it ready for development.
- To use the python packages of the operators install the required dependencies for them.
- You will need to install the dependencies separately for each operator you wish to use/develop.
Below is an example of installing dependencies for a single operator. Let's say we wish to install dependencies for the image-vec-rep-resnet
operator. Each operator folder has its own pyproject.toml
files. (Make sure that virtual environment is actiavted)
uv pip install -r operators/image_vec_rep_resnet/pyproject.toml
To properly check if the operator has been installed and working properly, you can run the test for the operator.
uv run -m unittest operators/image_vec_rep_resnet/test.py
More information about Operators can be found here
This is an optional test, but if you wish to see feluda
and its operators
in action, then an integration test is an ideal way to do that.
Below is an example on running the integration test for feluda
and the image_vec_rep_resnet
operator
- Build the
image_vec_rep_resnet
as a binary distribution
uv build --wheel operators/image_vec_rep_resnet/
This will create a build .whl
file in the dist/
folder in root of the codebase.
- Install the built package
uv pip install dist/<file_name>.whl
- Run the integration test
uv run -m unittest tests/feluda_integration_tests/test_01_feluda_and_image_vec_rep_resnet.py
To update the dependencies we have written a custom script that automatically updates each dependency version for all python packages.
# update lock file
uv lock --upgrade
# run the script from root
uv run -m scripts.toml_dependencies_update_script
To upgrade a single package to the latest version, while retaining the locked versions of all other packages:
uv lock --upgrade-package <package>
# OR
uv lock --upgrade-package <package>==<version>
# then run the script from root
uv run -m scripts.toml_dependencies_update_script