Complete development workflow for Pipelex - Python testing, linting, virtual environment management, and TDD practices
This skill provides comprehensive development standards and workflow practices for Pipelex, a declarative language for composable AI workflows.
Always lint after making changes:
```bash
make check
```
This runs:
Fix all reported issues before proceeding.
Run tests after code changes:
```bash
make test-xdist
```
For detailed error output:
```bash
make test-with-prints
```
Run specific tests:
```bash
make tp TEST=TestClassName
make tp TEST=test_function_name
```
Rerun only failed tests:
```bash
make tp TEST=LF
```
**CRITICAL**: Always activate the Python virtual environment before running commands:
```bash
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
.venv/bin/python -m pytest
.venv/bin/pipelex validate all
```
```python
pipe_code: str # Good - unbound until assigned
```
```python
from pipelex.types import StrEnum
```
```python
from pipelex import log, pretty_print
from pipelex.types import Self, StrEnum
```
```python
from pipelex.tools.typing.pydantic_utils import empty_list_factory_of
numbers: list[int] = Field(default_factory=empty_list_factory_of(int))
```
```python
try:
self.models_manager.setup()
except RoutingProfileLibraryNotFoundError as exc:
msg = "Library not found, run `pipelex init config`"
raise PipelexSetupError(msg) from exc
```
- `tests/unit/` - isolated function/class tests
- `tests/integration/` - component interaction tests
- `tests/e2e/` - complete workflow tests
- `tests/test_pipelines/` - pipeline definitions
```python
@pytest.mark.llm
@pytest.mark.inference
@pytest.mark.asyncio(loop_scope="class")
class TestFooBar:
@pytest.mark.parametrize("topic, test_case", [
TestCases.CASE_1,
TestCases.CASE_2,
])
async def test_pipe_processing(self, topic, test_case):
# Test implementation
```
1. **Write Test First** - Define expected behavior
2. **Write Minimal Code** - Just enough to pass the test
3. **Run Quality Checks** - `make check` for linting
4. **Validate Tests** - Ensure all tests pass
Use Material for MkDocs compatible markdown:
```python
def process_image(image_path: str, size: tuple[int, int]) -> bytes:
"""Process and resize an image.
Args:
image_path: Path to the source image
size: Tuple of (width, height) for resizing
Returns:
Processed image as bytes
"""
```
This skill ensures consistent, high-quality development practices across the Pipelex codebase with proper testing, linting, and documentation standards.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/pipelex-development-standards/raw