Getting started
This page will guide you through setting up and running Plugins for Tasks and Types, a Python project.
Prerequisites
Ensure you have Python installed on your system.
- Python:
>=3.10 - Operating Systems: Linux, macOS, Windows
Install
The recommended way to install flyte is using uv.
-
Install
uv: If you don't haveuvinstalled, you can get it withpip:pip install uvAlternatively, follow the instructions on the uv website.
-
Install
flyte: Onceuvis installed, you can install theflytepackage:uv pip install flyte
Hello world
Let's create a simple Flyte task and run it locally.
-
Create a Python file (e.g.,
my_app.py):import flyte
import asyncio
@flyte.task
def greet(name: str) -> str:
"""A simple task that greets the given name."""
return f"Hello, {name}!"
async def main_flow():
# Initialize Flyte locally
flyte.init()
# Run the task and print its output
result = await flyte.run(greet, name="Flyte User")
print(result)
if __name__ == "__main__":
asyncio.run(main_flow()) -
Run the application: Execute the script using
uv run python:uv run python my_app.pyYou should see the output:
Hello, Flyte User!
Verify
To ensure your installation is working correctly and all dependencies are met, you can run the project's unit tests.
-
Install development dependencies: The unit tests require additional development dependencies. Install them using
uv:uv pip install "flyte[dev]" -
Run unit tests: Use the provided
Makefileto run the unit tests:make unit_testYou should see output indicating the tests are running and their results.
Other install options
Besides uv, you can also install flyte using pip or pipx.
-
Using
pip:pip install flyte -
Using
pipx(for CLI-only usage):pipx install flyte
Troubleshooting
- Python version mismatch: If you encounter errors during installation related to Python versions, ensure your Python environment meets the
>=3.10requirement. You can check your version withpython --version. uvcommand not found: Ifuvis not recognized, make sure it's installed and its installation directory is in your system's PATH.makecommand not found: Themake unit_testcommand requiresmaketo be installed. On Windows, you might need to install a build toolchain like MinGW or use a Linux subsystem.