Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/
*.egg
.pytest_cache/
.coverage
htmlcov/
.tox/
.hypothesis/

# Virtual environments
.venv/
venv/
env/
ENV/
.pixi/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Git
.git/
.gitignore
.gitattributes

# CI/CD
.github/

# Documentation
docs/
*.md
!README.md

# Config files
.pre-commit-config.yaml
.flake8

# Docker/Container
Containerfile
Dockerfile
.dockerignore
.containerignore
docker-compose.yml

# Examples and tests
examples/
src/_test/

# Monitoring configs
conf/
36 changes: 31 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,38 @@ on:
branches: [main]

jobs:
test:
# Test using pixi (recommended)
test-pixi:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: latest
environments: dev

- name: Lint with flake8
run: pixi run -e dev lint

- name: Run tests with coverage
run: pixi run -e dev test-cov-ci

- name: Run pre-commit checks
run: pixi run -e dev pre-commit

# Test using pip (for compatibility)
test-pip:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -25,14 +52,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[all]
pip install .[dev]

- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
- name: Test with pytest and coverage
run: |
pytest
pytest --cov=src/arroyopy --cov-report=term --cov-fail-under=90
62 changes: 62 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Multi-stage build for arroyopy
#
# Build examples:
# Basic: podman build -t arroyopy .
# With ZMQ: podman build --build-arg EXTRAS=zmq -t arroyopy:zmq .
# With Redis: podman build --build-arg EXTRAS=redis -t arroyopy:redis .
# Full stack: podman build --build-arg EXTRAS="zmq,redis,file-watch" -t arroyopy:full .
#
# Run examples:
# podman run arroyopy --help
# podman run -v ./config:/config arroyopy run /config/pipeline.yaml
#
# Build arguments for optional dependencies
ARG EXTRAS=""

FROM python:3.12-slim AS builder

WORKDIR /app

# Install build dependencies
RUN pip install --no-cache-dir build

# Copy only what's needed for building
COPY pyproject.toml README.md LICENSE* ./
COPY src/ ./src/

# Build the wheel
RUN python -m build --wheel

# Final runtime image
FROM python:3.12-slim

ARG EXTRAS

WORKDIR /app

# Install runtime dependencies and the built wheel
COPY --from=builder /app/dist/*.whl /tmp/

# Install with optional extras if specified
RUN if [ -z "$EXTRAS" ]; then \
pip install --no-cache-dir /tmp/*.whl; \
else \
pip install --no-cache-dir "/tmp/*.whl[$EXTRAS]"; \
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing extras via pip install "/tmp/*.whl[$EXTRAS]" is not valid pip syntax for local wheel paths; extras need to be specified on the distribution name (e.g., arroyopy[zmq] @ file:///.../arroyopy-*.whl). As written, the image build will fail whenever EXTRAS is set. Consider using a direct-reference requirement string with the wheel filename, or switch to installing from source (pip install .[$EXTRAS]) in the runtime stage.

Suggested change
pip install --no-cache-dir "/tmp/*.whl[$EXTRAS]"; \
WHEEL_PATH=$(echo /tmp/*.whl) && \
pip install --no-cache-dir "arroyopy[$EXTRAS] @ file://${WHEEL_PATH}"; \

Copilot uses AI. Check for mistakes.
fi && \
rm /tmp/*.whl

# Create a non-root user
RUN useradd -m -u 1000 arroyo && \
chown -R arroyo:arroyo /app

USER arroyo

# Default command runs the CLI
ENTRYPOINT ["arroyo", "run"]
CMD ["--help"]

# Labels
LABEL org.opencontainers.image.title="arroyopy"
LABEL org.opencontainers.image.description="A library to simplify processing streams of data"
LABEL org.opencontainers.image.source="https://github.com/als-computing/arroyopy"
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
Loading
Loading