Skip to content
Merged
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
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: Release LazyOps on PyPI

on:
workflow_dispatch:
push:
paths:
- 'src/version.py'
- 'src/lzl/version.py'

workflow_run:
workflows: ["E2E Tests"]
branches: [main]
types:
- completed

jobs:
pypi:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}

name: Publish to PyPI
runs-on: ubuntu-latest
# Environment and permissions trusted publishing.
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: E2E Tests

on:
workflow_dispatch:
push:
branches: ["main"]
paths:
- 'src/version.py'
- 'src/lzl/version.py'
pull_request:
branches: ["main"]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
fail-fast: false

services:
redis:
image: redis:alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

minio:
# image: minio/minio:RELEASE.2024-12-18T13-15-44Z
image: minio/minio:edge-cicd
ports:
- 9000:9000
# - 9001:9001
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
options: >-
--health-cmd "curl --silent --fail http://localhost:9000/minio/health/live"
--health-interval 30s
--health-timeout 10s
Comment on lines +32 to +47

Copilot AI Dec 12, 2025

Copy link

Choose a reason for hiding this comment

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

Missing command for MinIO services. The GitHub Actions MinIO services don't specify the server command in the options field. MinIO requires an explicit command like server /data to start properly. While this is specified in the docker-compose files, it's missing from the GitHub Actions service definition.

Copilot uses AI. Check for mistakes.
--health-retries 5
volumes:
- /tmp/minio_data:/data

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: MinIO services missing required server command

Both minio and minio2 service containers have a comment stating "Start command is essential for MinIO" but no command is actually specified. The MinIO Docker image requires a command like server /data to start the server. Without this, the containers will not serve S3 requests. The docker-compose.e2e.yml file correctly includes command: server /data --console-address ":9090" but the GitHub Actions workflow is missing this configuration.

Additional Locations (1)

Fix in Cursor Fix in Web


minio2:
# image: minio/minio:RELEASE.2024-12-18T13-15-44Z
image: minio/minio:edge-cicd
ports:
- "9001:9000"
Comment thread
cursor[bot] marked this conversation as resolved.
# - "9091:9090"
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
options: >-
--health-cmd "curl --silent --fail http://localhost:9000/minio/health/live"
--health-interval 30s
--health-timeout 10s
Comment on lines +49 to +64

Copilot AI Dec 12, 2025

Copy link

Choose a reason for hiding this comment

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

Incorrect workflow configuration. The GitHub Actions workflow has minio2 service defined with port mapping "9001:9000" (line 52), but this conflicts with the minio service which already maps 9001:9001 (line 36). This will cause a port conflict. Additionally, both services use the same volume mount /tmp/minio_data:/data which could cause data corruption.

Copilot uses AI. Check for mistakes.
--health-retries 5
volumes:
- /tmp/minio_data2:/data

steps:
# Proceeding with file creation.
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install dependencies
run: |
uv sync --extra e2e

- name: Run E2E Tests
env:
MINIO_ENDPOINT: http://localhost:9000
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
MINIO2_ENDPOINT: http://localhost:9001
MINIO2_ACCESS_KEY: minioadmin
MINIO2_SECRET_KEY: minioadmin
MINIO2_REGION: us-east-1
REDIS_URL: redis://localhost:6379/0
run: |
uv run pytest tests/e2e -v -s
43 changes: 28 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ build.sh
*.vscode
*test_ops
tests/private_*
tests/_deprecated/private_*
!tests/
!lazyops/types/asyncprop/cached.py
lazyops/types/asyncprop/proxy.py
Expand All @@ -24,14 +25,15 @@ lazyops/libs/stream_unzip/lib.py
lazyops/libs/stream_unzip/inflate.py
lazyops/libs/stream_unzip/exceptions.py
lazyops/libs/stream_unzip/constants.py
tests/test_shelve.db.db
tests/_deprecated/test_shelve.db.db
lazyops/libs/unzip_stream*
lazyops/libs/jsonstate*
tests/local.cache
tests/local.hash
tests/local.lock
tests/libs/abcs/private_test_wrapper.py
tests/**/private**
tests/_deprecated/**/private**
tests/libs/abcs/k8s.py
# lazyops/libs/hatchet*
lazyops/libs/kinde/data
Expand All @@ -40,21 +42,21 @@ lazyops/libs/hatchet/cache
lazyops/libs/hatchet/data
src/lzl/api/hatchet/patches/context.j2.py
src/lzl/api/hatchet/patches/worker.j2.py
tests/lzl/hatchet.py
tests/_deprecated/lzl/hatchet.py
src/lzl/ext/fast/tests
src/lzl/.data/lzl.tmp.json
tests/lzl/exts/fastapi_oauth2.py
tests/_deprecated/lzl/exts/fastapi_oauth2.py
src/lazyops/*
/tests/lzl/exts/tmprl
tests/wrapping_v3.py
tests/wrapping_v2.py
tests/test_aiohttpx.py
tests/match_env_pattern.py
tests/lzl/test_psqla.py
tests/lzl/test_psql.py
tests/lzl/test_abcs.py
tests/lzl/settings.py
tests/lzl/db_sql_model.py
/tests/_deprecated/lzl/exts/tmprl
tests/_deprecated/wrapping_v3.py
tests/_deprecated/wrapping_v2.py
tests/_deprecated/test_aiohttpx.py
tests/_deprecated/match_env_pattern.py
tests/_deprecated/lzl/test_psqla.py
tests/_deprecated/lzl/test_psql.py
tests/_deprecated/lzl/test_abcs.py
tests/_deprecated/lzl/settings.py
tests/_deprecated/lzl/db_sql_model.py
src/lzl/api/slack/slack_context.json
tests/out/kvdb/components/session.pyi
tests/out/lzl/api/qdrant/client.pyi
Expand All @@ -63,11 +65,22 @@ tests/out/lzl/api/qdrant/client_v3.pyi
src/lzo/utils/.tmpdata
.cursor/mcp.json
.mcp.json
tests/lzl/file_08262025.py
tests/_deprecated/lzl/file_08262025.py

# MkDocs build artifacts
site/
.cache/
examples/file_performance_benchmark.py
!src/lzl/io/file/spec/providers/cached.py
!src/lzl/io/file/spec/paths/cached.py
!src/lzl/io/file/spec/paths/cached.py
test_persistence.lock
test_persistence.hash
test_persistence.cache
z_mcp.json
!tests/conftest.py
!tests/e2e/conftest.py
*.cache
*.lock
*.hash
!.github/workflows/tests.yml
*.log
67 changes: 67 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# LazyOps (lazyops)

## Project Overview

**LazyOps** is a Python library designed to provide a collection of utility modules and object registry patterns for building robust applications. It is currently under active refactoring to migrate core functionality into two distinct namespaces:

* **`lzl` (Lazy Libraries/Utilities):** Foundational utilities, async helpers, API clients, I/O operations, logging, and type definitions.
* **`lzo` (Lazy Objects/Registry):** Object registry patterns, state management, and configuration settings.

**Key Technologies:** Python 3.10+, Pydantic v2, AnyIO, Loguru, Typer.

## Architecture

The codebase is organized into a `src` layout:

* `src/lzl/`: Contains the utility modules (e.g., `io`, `logging`, `pool`, `proxied`, `require`).
* `src/lzo/`: Contains the object registry and pattern modules (e.g., `registry`, `types`, `utils`).
* `tests/`: Comprehensive test suite using `pytest`, mirrored to the source structure.

## Development Workflow

### Installation

To install the package in editable mode with all dependencies:

```bash
pip install -e ".[dev,docs,file,kops,fastapi]"
```

### Build & Run

The project uses `setuptools` configured via `pyproject.toml`.

* **CLI:** The project exposes a CLI entry point `lzl` (mapped to `lzl.cmd:main`).

### Testing

The project relies heavily on `pytest` and a `Makefile` to manage test execution.

**Common Test Commands:**

* `make test`: Run the entire test suite.
* `make test-lzl`: Run all documentation-focused submodule tests for `lzl`.
* Specific modules: `make test-lzl-io`, `make test-lzl-logging`, `make test-lzl-pool`, etc.
* `make test-lzo`: Run all `lzo` suite tests.
* Specific modules: `make test-lzo-registry`, `make test-lzo-types`.

### Documentation

Documentation is built using **MkDocs** with the Material theme and **Mintlify**.

* `make mkdocs-serve`: Serve documentation locally at `http://127.0.0.1:8000/`.
* `make mkdocs-build`: Build static documentation.
* `make docs-preview`: Preview via Mintlify.

## Key Files & Configuration

* **`pyproject.toml`**: Defines project metadata, dependencies (including optional groups like `kops`, `fastapi`), and build system.
* **`Makefile`**: The central entry point for running tests and documentation tasks.
* **`src/lzl/` & `src/lzo/`**: Core source code directories.
* **`README.md`**: Project overview and basic usage examples.

## Conventions

* **Namespaces:** strictly adhere to `lzl` for utilities and `lzo` for registry/objects.
* **Async First:** The library leans heavily on `anyio` and async patterns.
* **Pydantic:** Extensive use of Pydantic models and settings (`BaseSettings`, `BaseModel`) for configuration and validation.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,18 @@ mkdocs-build:
## mkdocs-deploy: Deploy MkDocs documentation to GitHub Pages
mkdocs-deploy:
$(MKDOCS) gh-deploy --force

# Spin up e2e environment
run-e2e-local: ## Run e2e tests locally
docker compose -f tests/docker-compose.e2e.yml up -d
uv sync --extra e2e
export MINIO_ENDPOINT=http://localhost:9000; \
export MINIO_ACCESS_KEY=minioadmin; \
export MINIO_SECRET_KEY=minioadmin; \
export MINIO2_ENDPOINT=http://localhost:9001; \
export MINIO2_ACCESS_KEY=minioadmin; \
export MINIO2_SECRET_KEY=minioadmin; \
export MINIO2_REGION=us-east-1; \
export REDIS_URL=redis://localhost:6389/0; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Incorrect Redis port in local e2e Makefile

The Makefile run-e2e-local target sets REDIS_URL=redis://localhost:6389/0, but the GitHub Actions workflow in .github/workflows/tests.yml uses REDIS_URL: redis://localhost:6379/0. The docker-compose.e2e.yml maps port 6389:6379, so the Makefile is correct for local runs but this inconsistency between CI and local environments may cause confusion or test failures if someone copies the wrong URL.

Fix in Cursor Fix in Web

uv run pytest tests/e2e -v -s
docker compose -f tests/docker-compose.e2e.yml down
Loading