Neops Task Runner for Python
This repository provides the base infrastructure and SDK to create workers for your own function blocks.
Installation
For users (pip):
For contributors (uv):
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone the repository and install dependencies
uv sync --group dev --extra test
- Use a .env file (with
python-dotenv):
Run the Worker
To run the worker locally:
If installed via pip, run it from your virtual environment:
You can also use the module form:
Development Tools
This project uses a modern Python toolchain for development:
| Tool | Purpose | Documentation |
|---|---|---|
| uv | Fast Python package and project manager | Getting Started |
| ruff | Extremely fast Python linter and formatter | Configuration |
| pyrefly | Fast type checker for Python | Documentation |
Common Commands
| Action | Command |
|---|---|
| Install dependencies | uv sync |
| Install with dev deps | uv sync --group dev |
| Install with all groups | uv sync --group dev --extra test |
| Add a package | uv add <pkg> |
| Add dev package | uv add --group dev <pkg> |
| Run a command | uv run <cmd> |
| Run the worker | uv run neops_worker |
| Build wheel | uv build |
| Publish package | uv publish |
Code Quality Commands
| Action | Command |
|---|---|
| Format code | uv run ruff format . |
| Check formatting | uv run ruff format --check . |
| Lint code | uv run ruff check . |
| Fix lint issues | uv run ruff check --fix . |
| Type check | uv run pyrefly check |
Make Targets
# Run linting (format check + lint check)
make lint
# Auto-format code
make format
# Run type checking (pyrefly)
make typeCheck
Code Style
Type Checking
We enforce strict typing for all Python files. The codebase is checked with pyrefly:
Formatting and Linting
Code formatting and linting are enforced by ruff:
# Check formatting
uv run ruff format --check ./neops_worker_sdk ./examples
# Auto-format
uv run ruff format ./neops_worker_sdk ./examples
# Lint
uv run ruff check ./neops_worker_sdk ./examples
# Lint and auto-fix
uv run ruff check --fix ./neops_worker_sdk ./examples
Docker
Build and run with Docker: