Skip to content
Closed
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
11 changes: 7 additions & 4 deletions .github/workflows/quality.yml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think the final result of this repo cannot use a workflow that runs tests on every sub-package. I think we should force some sort of consistent quality on each sub-package individually IFF your changes touch that subpackage.

For instance, we could have a standard way of defining the tests in a subpackage and then if there's changes to that folder, we run those tests. It won't catch everything, but it will prevent packages from preventing merges of other packages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

so essentially each sub-package would have its own CI and could run using a paths filter... that makes sense to me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK. I'll restructure this repo. Are sub directories under "mellea_contribs" used for grouping for the packages or categolized by the directory name?

mellea_contribs/integrations/langchain
or
mellea_contribs/integration_langchain

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm okay with either; will default to you.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install mellea from main branch
run: uv pip install git+https://github.com/generative-computing/mellea.git@main
# TODO: Enable pre-commit once code quality issues are fixed
# - name: pre-commit cache key
# run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
Expand All @@ -37,7 +35,7 @@ jobs:
# path: ~/.cache/pre-commit
# key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install dependencies
run: uv sync --frozen --all-extras --group dev
run: uv sync --all-extras --group dev
Comment on lines -40 to +38

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why did we take frozen out here?

# - name: Check style and run tests
# run: pre-commit run --all-files
# - name: Send failure message pre-commit
Expand All @@ -49,8 +47,13 @@ jobs:
run: nohup ollama serve &
- name: Pull model granite4:micro
run: ollama pull granite4:micro
- name: Run Tests
- name: Run Root Package Tests
run: uv run -m pytest -v test
continue-on-error: true
- name: Run mellea-integration-core Tests
run: cd integrations/mellea-integration-core && uv run pytest -v
- name: Run mellea-crewai Tests
run: cd integrations/crewai && PYTHONPATH=src:../mellea-integration-core/src uv run pytest -v --ignore=tests/integration
Comment on lines +50 to +56

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if the root tests fail, will this action still be marked as failing?

- name: Send failure message tests
if: failure()
run: echo "Tests failed. Please verify that tests are working locally."
5 changes: 4 additions & 1 deletion integrations/crewai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ classifiers = [

dependencies = [
"mellea>=0.3.0",
"mellea-integration-core>=0.1.0",
"mellea-integration-core",
"crewai>=0.1.0",
"pydantic>=2.0.0",
]

[tool.uv.sources]
mellea-integration-core = { workspace = true }

[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
Expand Down
3 changes: 3 additions & 0 deletions integrations/mellea-integration-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ dependencies = [
"mellea>=0.3.0",
]

[tool.uv]
# This package is part of the workspace

[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
Expand Down
4 changes: 2 additions & 2 deletions mellea_contribs/reqlib/citation_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import requests
from citeurl import Citator
from eyecite import get_citations
from mellea.stdlib.base import Context
from mellea.stdlib.requirement import Requirement, ValidationResult
from mellea.stdlib.context import Context
from mellea.stdlib.requirements import Requirement, ValidationResult
from playwright.sync_api import sync_playwright

# region citation_exists helpers
Expand Down
2 changes: 1 addition & 1 deletion mellea_contribs/reqlib/grounding_context_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json
from typing import Any

from mellea.stdlib.base import Component, TemplateRepresentation
from mellea.stdlib.components import Component, TemplateRepresentation


class GroundingContextFormatter(Component):
Expand Down
4 changes: 2 additions & 2 deletions mellea_contribs/reqlib/import_repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import tempfile
from pathlib import Path

from mellea.stdlib.base import Context
from mellea.stdlib.requirement import Requirement, ValidationResult
from mellea.stdlib.context import Context
from mellea.stdlib.requirements import Requirement, ValidationResult

from .import_resolution import (
ImportSuggestion,
Expand Down
4 changes: 2 additions & 2 deletions mellea_contribs/reqlib/is_appellate_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
import re

from mellea.stdlib.base import Context
from mellea.stdlib.requirement import Requirement, ValidationResult
from mellea.stdlib.context import Context
from mellea.stdlib.requirements import Requirement, ValidationResult

# ------------------------------------------------------------ #
# FUNCTIONS SUPPORTING CASE NAME AS INPUT TO IS_APPELLATE_CASE #
Expand Down
8 changes: 4 additions & 4 deletions mellea_contribs/tools/double_round_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"""

import json
import logging
from typing import Any, Dict, List, Optional, Tuple

from mellea.backends.types import ModelOption
from mellea.helpers.fancy_logger import FancyLogger
from mellea.stdlib.requirement import req, simple_validate
from mellea.backends import ModelOption
from mellea.stdlib.requirements import req, simple_validate
from mellea.stdlib.sampling import RejectionSamplingStrategy

logger = FancyLogger.get_logger()
logger = logging.getLogger(__name__)

DRR_CACHE: dict[str, Any] = {}

Expand Down
4 changes: 2 additions & 2 deletions mellea_contribs/tools/top_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import json
from typing import Any, Dict, List, Optional, Tuple

from mellea.backends.types import ModelOption
from mellea.stdlib.requirement import req, simple_validate
from mellea.backends import ModelOption
from mellea.stdlib.requirements import req, simple_validate
from mellea.stdlib.sampling import RejectionSamplingStrategy

TOP_K_CACHE: dict[str, Any] = {}
Expand Down
20 changes: 17 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "mellea-contribs"
Expand All @@ -27,6 +27,9 @@ dependencies = [
"markdown",
]

[tool.hatch.build.targets.wheel]
packages = ["mellea_contribs"]

[project.optional-dependencies]
robustness = [
"benchdrift",
Expand Down Expand Up @@ -145,5 +148,16 @@ parser_angular_allowed_types = "build,chore,ci,docs,feat,fix,perf,style,refactor
parser_angular_minor_types = "release"
parser_angular_patch_types = "fix,perf,feat"

[tool.uv]
# Define workspace members
[tool.uv.workspace]
members = [
".",
"integrations/mellea-integration-core",
"integrations/crewai",
]

[tool.uv.sources]
benchdrift = { git = "https://github.com/IBM/BenchDrift.git", rev = "95db1c95b6abbc3b9f9bc177f6a7933c555c7175" }
benchdrift = { git = "https://github.com/IBM/BenchDrift.git", rev = "95db1c95b6abbc3b9f9bc177f6a7933c555c7175" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think non-workspace member packages (that aren't used for top-level quality control / testing) should be moved to individual workspace pyproject.toml files.

mellea-integration-core = { workspace = true }
mellea-crewai = { workspace = true }
2 changes: 1 addition & 1 deletion test/test_citation_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from unittest.mock import patch, MagicMock

from mellea.stdlib.base import Context
from mellea.stdlib.context import Context
from mellea_contribs.reqlib.citation_exists import *


Expand Down
4 changes: 2 additions & 2 deletions test/test_double_round_robin.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import sys
import os
import logging

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

from mellea_contribs.tools.double_round_robin import double_round_robin
from mellea import start_session
from mellea.helpers.fancy_logger import FancyLogger

FancyLogger.get_logger().setLevel("WARNING")
logging.getLogger().setLevel(logging.WARNING)

ITEMS = [
{
Expand Down
2 changes: 1 addition & 1 deletion test/test_grounding_context_formatter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from mellea_contribs.reqlib.grounding_context_formatter import GroundingContextFormatter
from mellea.stdlib.base import TemplateRepresentation
from mellea.stdlib.components import TemplateRepresentation


def print_header(title):
Expand Down
2 changes: 1 addition & 1 deletion test/test_is_appellate_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

from mellea import start_session
from mellea.stdlib.requirement import req
from mellea.stdlib.requirements import req
from mellea.stdlib.sampling import RejectionSamplingStrategy
from mellea_contribs.reqlib.is_appellate_case import (
court_abbv_from_citation,
Expand Down
5 changes: 1 addition & 4 deletions test/test_mprogram_robustness.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
from pathlib import Path

from mellea import start_session
try:
from mellea.backends.types import ModelOption
except ImportError:
from mellea.backends import ModelOption
from mellea.backends import ModelOption
from mellea_contribs.tools.benchdrift_runner import (
run_benchdrift_pipeline,
analyze_robustness,
Expand Down
Loading
Loading