Thanks for your interest in contributing to fiftyone-plugins!
If you plan to contribute a PR, please check install the pre-commit hooks before committing:
pre-commit installYou can manually lint a file if necessary like so:
# Manually run linting configured in the pre-commit hook
pre-commit run --files <file>When developing locally, you must make your source install of this repository available to FiftyOne.
A convenient way to do that is to symlink this repository into your FiftyOne plugins directory:
cd /path/to/fiftyone-plugins
ln -s "$(pwd)" "$(fiftyone config plugins_dir)/voxelgpt"- Follow these instructions to install Fiftyone from source
- Checkout contribution guide for Fiftyone project
- Set the
FIFTYONE_DIRenvironment variable to the location where you cloned thefiftyonerepository
- Run
yarn install
- Run
yarn create-plugin <your-plugin-name>to create a new plugin
- Run
bash install.bashto install the dev dependencies
- Run
yarn workspace <plugin-name> devto compile/watch a plugin
To get started with building a new JavaScript plugin outside of fiftyone-plugins repository, use the hello-world-plugin-js repository as a base. It provides a minimal, working template that includes a sample JavaScript operator and a sample JavaScript panel. Clone the repository, rename it appropriately, and customize the operator and panel to fit your use case.
This project contains multiple plugins, each with its own set of tests. To
simplify the testing process, we've included a script called run_all_tests.sh
that automatically finds and runs tests in all plugin directories.
The run_tests.sh script:
- Iterates through all subdirectories under the
./pluginsdirectory. - Checks each plugin for a non-empty
testsdirectory. - Runs
pytestin eachtestsdirectory found. - Reports test results and indicates whether all tests passed or if any failures occurred.
- Adds the
./pluginsdirectory to thePYTHONPATH.
To run tests for all plugins, simply execute the script using the following command:
# ensure pytest is installed
pip install pytest
# run all the tests
bash run_tests.sh
# or run an individual plugins tests
bash run_tests.sh hello_worldYou can also use pytest directly by emulating the setup in run_tests.sh.
- Ensure you have
$FIFTYONE_PLUGINS_DIR/pluginsin yourPYTHONPATH - Run a test file and use
pytestas expected - eg
pytest ./plugins/hello_world/test_count_samples.py -v