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
10 changes: 4 additions & 6 deletions converters/honeydew/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,23 @@ Bidirectional converter between [OSI](../../core-spec/spec.md) semantic models a
## Setup

```bash
pip install .
# or in editable mode for development:
pip install -e .
uv sync
```

## Usage

```bash
# OSI YAML → Honeydew workspace directory
python src/honeydew_osi_converter.py osi-to-honeydew -i input.yaml -o output_dir/
uv run honeydew-osi osi-to-honeydew -i input.yaml -o output_dir/

# Honeydew workspace directory → OSI YAML
python src/honeydew_osi_converter.py honeydew-to-osi -i workspace_dir/ -o output.yaml
uv run honeydew-osi honeydew-to-osi -i workspace_dir/ -o output.yaml
```

## Tests

```bash
python -m pytest tests/
uv run pytest
```

## Limitations
Expand Down
43 changes: 32 additions & 11 deletions converters/honeydew/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,49 @@
# specific language governing permissions and limitations
# under the License.


[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
"pytest>=8.0",
]

[project]
name = "honeydew-osi"
version = "0.2.0.dev0"
description = "Bidirectional converter between Honeydew workspace YAML and OSI semantic model"
readme = "README.md"
authors = [{ name = "Apache Software Foundation", email = "dev@ossie.apache.org" }]
requires-python = ">=3.12"
readme = "README.md"
license = "Apache-2.0"
keywords = [
"Apache Ossie",
"Ossie",
"Open Semantic Interchange",
"Honeydew"
]
dependencies = [
"pyyaml>=6.0",
]

[dependency-groups]
dev = [
"pytest>=8.0",
]
[project.scripts]
honeydew-osi = "honeydew_osi.converter:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project.urls]
homepage = "https://ossie.apache.org/"
repository = "https://github.com/apache/ossie/"

[tool.hatch.build]
include = ["src/**/*"]
[tool.hatch.build.targets.wheel]
packages = ["src/honeydew_osi"]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]

[tool.uv]
required-version = ">=0.9.0"
default-groups = [
"dev"
]
16 changes: 16 additions & 0 deletions converters/honeydew/src/honeydew_osi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
Honeydew → OSI: Reads a Honeydew workspace directory and produces an OSI YAML.

Usage:
python honeydew_osi_converter.py osi-to-honeydew -i input.yaml -o output_dir/
python honeydew_osi_converter.py honeydew-to-osi -i workspace_dir/ -o output.yaml
python converter.py osi-to-honeydew -i input.yaml -o output_dir/
python converter.py honeydew-to-osi -i workspace_dir/ -o output.yaml
"""

import argparse
Expand Down
9 changes: 4 additions & 5 deletions converters/honeydew/tests/test_honeydew_osi_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import pytest
import yaml

sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src"))
from honeydew_osi_converter import (
from honeydew_osi.converter import (
HoneydewConversionError,
_assign_metrics_to_entities,
_build_osi_metadata,
Expand Down Expand Up @@ -1445,7 +1444,7 @@ def test_main_osi_to_honeydew(tmp_path):
}))
output_dir = tmp_path / "out"
result = subprocess.run(
[sys.executable, str(Path(__file__).resolve().parent.parent / "src" / "honeydew_osi_converter.py"),
[sys.executable, "-m", "honeydew_osi.converter",
"osi-to-honeydew", "-i", str(input_file), "-o", str(output_dir)],
capture_output=True, text=True,
)
Expand All @@ -1463,7 +1462,7 @@ def test_main_honeydew_to_osi(tmp_path):
}])
output_file = tmp_path / "output.yaml"
result = subprocess.run(
[sys.executable, str(Path(__file__).resolve().parent.parent / "src" / "honeydew_osi_converter.py"),
[sys.executable, "-m", "honeydew_osi.converter",
"honeydew-to-osi", "-i", str(tmp_path), "-o", str(output_file)],
capture_output=True, text=True,
)
Expand All @@ -1488,7 +1487,7 @@ def test_main_path_traversal_rejected(tmp_path):
)
output_dir = tmp_path / "out"
result = subprocess.run(
[sys.executable, str(Path(__file__).resolve().parent.parent / "src" / "honeydew_osi_converter.py"),
[sys.executable, "-m", "honeydew_osi.converter",
"osi-to-honeydew", "-i", str(input_file), "-o", str(output_dir)],
capture_output=True, text=True,
)
Expand Down
Loading